![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Hengelo
Posts: 79
|
Hello All,
I have data in column A, e.g. in cell A1, A10, A76, a189, Ax, ... . I want to know the first cell with data from the bottom up. So I don't want to start in A1 but in A1000. Is that possible in VB!?
__________________
Best regards, Martin J.A. Maatman Oonk |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
Would something like this help...
Lastrow = Range("A65000").End(xlUp).Row (Returns the row number of the last cell in column A with data in) |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
Use something like: -
For x = 1000 To 1 Step -1 If Not IsEmpty(Cells(x, 1)) Then Exit For Next x MsgBox "Cell A" & x & " is the first cell with data in." |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sunny, spring-like Hull
Posts: 3,339
|
AJ's is better
|
|
|
|
|
|
#5 | |
|
Board Regular
Join Date: Feb 2002
Location: Hengelo
Posts: 79
|
Quote:
__________________
Best regards, Martin J.A. Maatman Oonk |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|