I have code that I regularly use to update a ROW source for amending data that is in a row (going across), but I cannot figure out how to do the same thing but from a column.
("Inc_ID" is located somewhere in column A)
Where: (r, 2), (r, 4), (r, 18), or (r, 6) are all cells located 2 columns over from "Inc_ID" , or 4 columns over, or 18 columns over... etc...
But... what if 'Inc_ID' is located somewhere in row 1 (in some column) and I want to go DOWN from that specific cell. How do i define my new range for going down rows instead of going across columns like the above code does? (sure hope that makes sense... thank you)
Code:
Private Sub cmdAdd1_Click()
Dim DynRng As Range, Inc_ID As String, r As Long
Set DynRng = Worksheets("Seatex Incident Log").Range("DynamicRange")
Inc_ID = txtIncidentID1
r = Application.WorksheetFunction.Match(Inc_ID, DynRng.Resize(, 1), 0)
DynRng.Cells(r, [COLOR=#000080][B]2[/B][/COLOR]).Value = Me.DTPicker3.Value
DynRng.Cells(r, [COLOR=#000080][B]4[/B][/COLOR]).Value = Me.cboPriority1.Value
DynRng.Cells(r, [COLOR=#000080][B]18[/B][/COLOR]).Value = Me.chkCAPA1.Value
DynRng.Cells(r, [COLOR=#000080][B]6[/B][/COLOR]).Value = Me.cboLocation1.Value
Where: (r, 2), (r, 4), (r, 18), or (r, 6) are all cells located 2 columns over from "Inc_ID" , or 4 columns over, or 18 columns over... etc...
But... what if 'Inc_ID' is located somewhere in row 1 (in some column) and I want to go DOWN from that specific cell. How do i define my new range for going down rows instead of going across columns like the above code does? (sure hope that makes sense... thank you)