Hi Everyone,
In a formatting step of a larger macro, I am trying to select a variable number of rows beginning with cell C9:J, and then sort alphabetically. Below is what I have written, but it doesn't seem to be working so far (no errors given though).
Dim LRowC As Long
LRowC = Cells(Rows.Count, "C").End(xlUp).Row
Range("C9:J" & LRowC).Sort Key1:=Range("C9:C" & LRowC), _
Order1:=xlDescending, Header:=xlNo
Additionally I am trying to use a simliar process to copy vlookup formulas down column D next to all non-blank cells in column C. This is only working until about 5 rows down and I'm just stumped. Obviously I have something wrong in my understanding of the copy to last row coding here and I would really appreciate any corrected formulas/advice. Thanks!
Dim LRowD As Long
LRowD = Cells(Rows.Count, 1).End(xlUp).Row
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'MATC Positions'!R2C3:R4000C12,3,FALSE)"
Range("D9").Select
Selection.AutoFill Destination:=Range("D9:D" & LRowD)
In a formatting step of a larger macro, I am trying to select a variable number of rows beginning with cell C9:J, and then sort alphabetically. Below is what I have written, but it doesn't seem to be working so far (no errors given though).
Dim LRowC As Long
LRowC = Cells(Rows.Count, "C").End(xlUp).Row
Range("C9:J" & LRowC).Sort Key1:=Range("C9:C" & LRowC), _
Order1:=xlDescending, Header:=xlNo
Additionally I am trying to use a simliar process to copy vlookup formulas down column D next to all non-blank cells in column C. This is only working until about 5 rows down and I'm just stumped. Obviously I have something wrong in my understanding of the copy to last row coding here and I would really appreciate any corrected formulas/advice. Thanks!
Dim LRowD As Long
LRowD = Cells(Rows.Count, 1).End(xlUp).Row
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'MATC Positions'!R2C3:R4000C12,3,FALSE)"
Range("D9").Select
Selection.AutoFill Destination:=Range("D9:D" & LRowD)