-
Mar 2nd, 2021, 03:24 PM
#1
Thread Starter
PowerPoster
LAST blank cell
I need to retun in ULTIMA (Dim as Long), the last blank cell in column B of FOGLiO1...
i use:
Code:
Sub latebinding(NOMEFILE)
Set XLAPP = CreateObject("Excel.Application")
Set XLWB = XLAPP.Workbooks.Open(Directory & NOMEFILE)
Set XLWS = XLWB.Worksheets("FOGLIO1")
End Sub
-
Mar 2nd, 2021, 05:45 PM
#2
Hyperactive Member
Re: LAST blank cell
Do you mean the last blank row that has data in some other column? I mean, all the cells are blank at a certain point...
-
Mar 2nd, 2021, 07:27 PM
#3
Re: LAST blank cell
Unfortunately, luca is not known for providing clear, concise, and detailed descriptions of what he is looking for.
If I were guessing, I would say he wants the FIRST blank cell after the last cell that has data, but that is just a guess.
-
Mar 3rd, 2021, 04:07 AM
#4
Re: LAST blank cell
the last blank cell in column B of FOGLiO1...
the last blank row in B is generally B1048576
if you want the last row with data
Code:
lastrow = cells(rows.count, 2).end(xlup).row
if you want the next row, the first empty cell below the data
Code:
nextrow = cells(rows.count, 2).end(xlup).offset(1).row
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|