Phillip Marley
New Member
- Joined
- Jun 13, 2022
- Messages
- 3
- Office Version
- 365
- 2010
Hi all
I am trying to get the row number of the last cell with data in, in col A so that I can copy data from another sheet and put it under the existing data in the active sheet. the spreadsheet has been formatted down to row 5000 in alternate blue and white rows so when i try to find the last row with data in it comes up with with row 5000 which is the last formatted row. the actual last row with data is row 850.
my first code was
Dim J1 As Integer
J1 = Range("A65536").End(xlUp).Row
I tried the code below which returns myRng as a1:a850 (at least it finds the correct last row with data) but I need to store the cell number 850 as a parameter . how to I get that from the returned range.
Dim myRng As Range
Set myRng = Range("a1:a10000").SpecialCells(xlCellTypeConstants) ( I chose a10000 at random because the file will never get that big)
Thanks
Phill
I am trying to get the row number of the last cell with data in, in col A so that I can copy data from another sheet and put it under the existing data in the active sheet. the spreadsheet has been formatted down to row 5000 in alternate blue and white rows so when i try to find the last row with data in it comes up with with row 5000 which is the last formatted row. the actual last row with data is row 850.
my first code was
Dim J1 As Integer
J1 = Range("A65536").End(xlUp).Row
I tried the code below which returns myRng as a1:a850 (at least it finds the correct last row with data) but I need to store the cell number 850 as a parameter . how to I get that from the returned range.
Dim myRng As Range
Set myRng = Range("a1:a10000").SpecialCells(xlCellTypeConstants) ( I chose a10000 at random because the file will never get that big)
Thanks
Phill