I have the following macro selecting a dynamic range in worksheet. I need it to select the dynamic range, but without the last three columns. What line would I use, and where to offset like this?
Sub ProcessData()
'Dynamic Range Selection
Application.Calculation = x1CalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = False
Dim startcell As Range, lastrows As Long, lastcol As Long, ws As Worksheet
Set ws = Sheet1
Set startcell = Range("a2")
lastrow = ws.Cells(ws.Rows.Count, startcell.Column).End(xlUp).Row
lastcol = ws.Cells(startcell.Row, ws.Columns.Count).End(xlToLeft).Column
ws.Range(startcell, ws.Cells(lastrow, lastcol)).Select
Application.Calculation = x1calculationa
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Thank you!
Judi
Sub ProcessData()
'Dynamic Range Selection
Application.Calculation = x1CalculationManual
Application.EnableEvents = False
Application.ScreenUpdating = False
Dim startcell As Range, lastrows As Long, lastcol As Long, ws As Worksheet
Set ws = Sheet1
Set startcell = Range("a2")
lastrow = ws.Cells(ws.Rows.Count, startcell.Column).End(xlUp).Row
lastcol = ws.Cells(startcell.Row, ws.Columns.Count).End(xlToLeft).Column
ws.Range(startcell, ws.Cells(lastrow, lastcol)).Select
Application.Calculation = x1calculationa
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Thank you!
Judi