I have some code that opens an excel spreadsheet and gets the last empty row in that column. The problem I am having is that I have two tables created in my excel spreadsheet. I want to be able to only select the range of B7:B94 for column B as I have data that represents another table starting at B:101 Here is my code so far...
Const xlUp = -4162 Set xlApp = CreateObject("Excel.Application") With xlApp .Visible = False Set xlWB = .Workbooks.Open("M:\Shared Documents\Job Cost Analysis\Hi-Tech BPO\Logs\" & currentMonth & "-Summary Hi Tech BPO.xlsx", , False) Set ws = .Worksheets(sheetName) Dim LR '''''''''''Here is where I want to select the range of B7:B94'''''''''''''' LR = .Range("B" & .Rows.count).End(xlUp).Row .Range("B" & LR + 1).Value = RIGHT(client_id,LEN(client_id)-7) End With xlApp.DisplayAlerts = False xlWB.SaveAs ("M:\Shared Documents\Job Cost Analysis\Hi-Tech BPO\Logs\" & currentMonth & "-Summary Hi Tech BPO.xlsx") xlWB.Close xlApp.Quit
LR = .Range("B101").End(xlUp).Rowdoes not work?