T
troy_lee
Here is my code.
Dim LastRow, LastCol As Long
Dim LastCell As Range
Dim LastCellAddress As Range
Dim intNumCols As Long
Dim DataCells As Range
'Find the last row, column and last cell of the worksheet.
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
LastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
'Set LastCell = ActiveSheet.Cells(LastRow, LastCol)
'Select from "A2" to the last cell.
Range("A2").Select
Set DataCells = Cells("A2").Resize(LastRow, LastCol).Select
I keep failing at the last line, trying to set the range variable. I
get a Type Mismatch error. I have tried everything. I don't understand
the mismatch error. DataCells is a range correct? Are my LastRow and
LastCol arguments to the Resize method good?
This should be so easy. Thanks in advance for your help.
Dim LastRow, LastCol As Long
Dim LastCell As Range
Dim LastCellAddress As Range
Dim intNumCols As Long
Dim DataCells As Range
'Find the last row, column and last cell of the worksheet.
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
LastCol = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
'Set LastCell = ActiveSheet.Cells(LastRow, LastCol)
'Select from "A2" to the last cell.
Range("A2").Select
Set DataCells = Cells("A2").Resize(LastRow, LastCol).Select
I keep failing at the last line, trying to set the range variable. I
get a Type Mismatch error. I have tried everything. I don't understand
the mismatch error. DataCells is a range correct? Are my LastRow and
LastCol arguments to the Resize method good?
This should be so easy. Thanks in advance for your help.