Results 1 to 4 of 4

Thread: LAST blank cell

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Location
    Italy-Napoli
    Posts
    2,109

    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

  2. #2
    Addicted Member
    Join Date
    Jan 2018
    Posts
    150

    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...

  3. #3
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,813

    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.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,298

    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
  •  



Click Here to Expand Forum to Full Width