+ Reply to Thread
Results 1 to 3 of 3

Textbox.caption to cell if empty, how?

Hybrid View

  1. #1
    WTG
    Guest

    Textbox.caption to cell if empty, how?

    I have a userform with a text box, that I've typed some information
    into.
    I now want to save that information to cell B1 on my "EmpData"
    worksheet. but only if that cell is empty. if it's not, then writh the
    text to cell B2.

    What I thought I'd do was write an if statement that basicly says

    if B(VAR)=" " Then
    EmpData!B1 = TxtBox.caption
    if not then Var=var+1

    then just have it repeat itself over again.

    and keep doing this adding a 1 to the Var until it finds a empty cell.

    ( B1,B2,B3,B4.....)

    Can this be done?

    I don't know VBA, and my VB is more then a little rusty.

    Thanks for any help you can give me.

    Wally



  2. #2
    Earl Kiosterud
    Guest

    Re: Textbox.caption to cell if empty, how?

    Wally,

    Sheets("EmpData").Range("B1").End(xlDown).Offset(1, 0) = TxtBox.Value
    --
    Earl Kiosterud
    mvpearl omitthisword at verizon period net
    -------------------------------------------

    "WTG" <wtg_designs@hotmail.com> wrote in message
    news:t28221pbh79mjgj0tvvuasu036h84i72qa@4ax.com...
    >I have a userform with a text box, that I've typed some information
    > into.
    > I now want to save that information to cell B1 on my "EmpData"
    > worksheet. but only if that cell is empty. if it's not, then writh the
    > text to cell B2.
    >
    > What I thought I'd do was write an if statement that basicly says
    >
    > if B(VAR)=" " Then
    > EmpData!B1 = TxtBox.caption
    > if not then Var=var+1
    >
    > then just have it repeat itself over again.
    >
    > and keep doing this adding a 1 to the Var until it finds a empty cell.
    >
    > ( B1,B2,B3,B4.....)
    >
    > Can this be done?
    >
    > I don't know VBA, and my VB is more then a little rusty.
    >
    > Thanks for any help you can give me.
    >
    > Wally
    >
    >




  3. #3
    WTG
    Guest

    Re: Textbox.caption to cell if empty, how?

    Thanks, I'll try it


    On Sat, 26 Feb 2005 22:10:18 -0500, "Earl Kiosterud"
    <nothanks@nospam.com> wrote:

    >Wally,
    >
    >Sheets("EmpData").Range("B1").End(xlDown).Offset(1, 0) = TxtBox.Value



+ 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