kjohn25744
New Member
- Joined
- Oct 11, 2021
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
I need to replace the row number in a range with a variable and can't seem to get the correct syntax. I have the code written to get the last row in a column and want to use that variable I named lRow. Here is the line in the code from a Marco I recorded that needs to be replaced.
Range ("D24").Select
My variable for the last row is called lRow. I am trying to replace the "24" in the above select with the following but I can't seem to find the correct syntax. Here is what I have tried.
Range("D & lRow").Select
Range(D" & lRow").Select
Range ("D24").Select
My variable for the last row is called lRow. I am trying to replace the "24" in the above select with the following but I can't seem to find the correct syntax. Here is what I have tried.
Range("D & lRow").Select
Range(D" & lRow").Select