+ Reply to Thread
Results 1 to 7 of 7

Re: Select last cell before blank, then offset

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Select last cell before blank, then offset

    i'm facing a problem right now. i'm doing a for loop for the columns but as the table is dynamic, i cant do a Range(C13:C14) as C14 will be changing with every new inputs.

    therefore, how do i return the last cell so that i can put in the cell number in my sub() ?

    Thanks for your time.
    Last edited by Leith Ross; 03-19-2009 at 02:14 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Select last cell before blank, then offset

    You might get bettr help if you post the fullcode
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Select last cell before blank, then offset

    I agree with Roy that it's not particularly easily to understand what it is you're doing exactly but I would say that given you're running 2007 it may be better to use Rows.Count rather than 65536, eg:

    Please Login or Register  to view this content.
    Rows.Count is generally regarded as optimal now I think given the difference in default Rows between pre and post 2007 versions.

  4. #4
    Registered User
    Join Date
    03-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Select last cell before blank, then offset

    Erm, sorry, i'm new to vb. Can it return a cell number?

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Select last cell before blank, then offset

    What do you mean by Cell Number?

  6. #6
    Registered User
    Join Date
    03-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Select last cell before blank, then offset

    meaning er like, i got a For each cell in Range(C13:C23)

    but this C23 is not constant, meaning it is dynamic and there will be new entry coming in which means next time will be C13:C24 and so on.

    How do I check for this and put it into my For each statements?

  7. #7
    Registered User
    Join Date
    03-19-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Select last cell before blank, then offset

    hey guys, this is what i have:

    For i = 1 To ddd.count
    UserForm1.TextBox1.Text = ddd.Item(i)
    Next i
    UserForm1.Show

    Basically what I want to do is to append the items in ddd (collections) to the TextBox. How do you go about doing it?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1