+ Reply to Thread
Results 1 to 6 of 6

New to me

  1. #1
    Striker
    Guest

    New to me

    I am kind of new to VBA. I picked up a book and will try to figure it all
    out. In reading through some of the posts, this board looks like a good
    place to ask questions. Please let me know if there is a better one.

    Question. In Excel 2002, I want to load a form that copies text data from a
    row of cells into a form. So my first question is how do I load the form I
    created? What I did is add a module with one sub that just loads the form
    into memory, like below....

    Sub LoadForm()
    Range("A2").Select
    Load frmMain
    End Sub

    Then I was thinking about putting code to copy cells of data into text boxes
    using the offset method from "A2" in the Form Initialize event.

    I want the user to manually start the form, so am I on the correct track
    with where I'm going?



  2. #2
    Tom Ogilvy
    Guest

    RE: New to me

    Sub LoadForm()
    Range("A2").Select
    frmMain.Show
    End Sub

    would load and show the form.

    It sounds like you are going in the right direction.

    --
    Regards,
    Tom Ogilvy


    "Striker" wrote:

    > I am kind of new to VBA. I picked up a book and will try to figure it all
    > out. In reading through some of the posts, this board looks like a good
    > place to ask questions. Please let me know if there is a better one.
    >
    > Question. In Excel 2002, I want to load a form that copies text data from a
    > row of cells into a form. So my first question is how do I load the form I
    > created? What I did is add a module with one sub that just loads the form
    > into memory, like below....
    >
    > Sub LoadForm()
    > Range("A2").Select
    > Load frmMain
    > End Sub
    >
    > Then I was thinking about putting code to copy cells of data into text boxes
    > using the offset method from "A2" in the Form Initialize event.
    >
    > I want the user to manually start the form, so am I on the correct track
    > with where I'm going?
    >
    >
    >


  3. #3
    Bob Phillips
    Guest

    Re: New to me



    "Striker" <striker3070@qwest.net> wrote in message
    news:u6LUVxkWGHA.3848@TK2MSFTNGP05.phx.gbl...
    > I am kind of new to VBA. I picked up a book and will try to figure it all
    > out. In reading through some of the posts, this board looks like a good
    > place to ask questions. Please let me know if there is a better one.


    Oh yeah, the one across the road is much better, that is why we are all
    here.

    No, this is the best. No ifs, no buts, the best. You get Tom Ogilvy here,
    occasionally Rob Bovey and Stephen Bullen, Harlan Grove checks in
    occasionally, Ron de Bruin, Dave Peterson, Norman Jones, Jim Cone, Papou,
    Michael Pierron, Chip Pearson, KJon Peltire, Jan Karel Pieterse,... It
    doesn't get an y better than this

    > Question. In Excel 2002, I want to load a form that copies text data from

    a
    > row of cells into a form. So my first question is how do I load the form

    I
    > created? What I did is add a module with one sub that just loads the form
    > into memory, like below....
    >
    > Sub LoadForm()
    > Range("A2").Select
    > Load frmMain
    > End Sub


    Sub LoadForm()
    Load frmMain
    With frmMain
    .Textbox1.Text = Range("A2").Text
    .Textbox2.Text = Range("A2").Offest(1,0).Text
    .Textbox3.Text = Range("A2").Offest(2,0).Text
    'etc.
    .Show
    End With



    End Sub



  4. #4
    Ron de Bruin
    Guest

    Re: New to me

    Hi Striker

    See this KB
    http://support.microsoft.com/default...b;EN-US;829070


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Striker" <striker3070@qwest.net> wrote in message news:u6LUVxkWGHA.3848@TK2MSFTNGP05.phx.gbl...
    >I am kind of new to VBA. I picked up a book and will try to figure it all out. In reading through some of the posts, this board
    >looks like a good place to ask questions. Please let me know if there is a better one.
    >
    > Question. In Excel 2002, I want to load a form that copies text data from a row of cells into a form. So my first question is
    > how do I load the form I created? What I did is add a module with one sub that just loads the form into memory, like below....
    >
    > Sub LoadForm()
    > Range("A2").Select
    > Load frmMain
    > End Sub
    >
    > Then I was thinking about putting code to copy cells of data into text boxes using the offset method from "A2" in the Form
    > Initialize event.
    >
    > I want the user to manually start the form, so am I on the correct track with where I'm going?
    >




  5. #5
    Striker
    Guest

    Re: New to me

    WOW great response. OK now I am putting a command button to move to the
    next row and put text from that row into the test boxes. I think I can use
    the offset method to do this, but I need to be careful in case someone has
    changes the text in the form, I need to copy to the spreadsheet.

    From reading thru this forum I was thinking about setting a variable (bool)
    to make the form dirty. Perhaps bDirty as booleen. Would this be a global
    variable in the module, or could it be a global variable in the form?



    "Striker" <striker3070@qwest.net> wrote in message
    news:u6LUVxkWGHA.3848@TK2MSFTNGP05.phx.gbl...
    >I am kind of new to VBA. I picked up a book and will try to figure it all
    >out. In reading through some of the posts, this board looks like a good
    >place to ask questions. Please let me know if there is a better one.
    >
    > Question. In Excel 2002, I want to load a form that copies text data from
    > a row of cells into a form. So my first question is how do I load the
    > form I created? What I did is add a module with one sub that just loads
    > the form into memory, like below....
    >
    > Sub LoadForm()
    > Range("A2").Select
    > Load frmMain
    > End Sub
    >
    > Then I was thinking about putting code to copy cells of data into text
    > boxes using the offset method from "A2" in the Form Initialize event.
    >
    > I want the user to manually start the form, so am I on the correct track
    > with where I'm going?
    >




  6. #6
    Bob Phillips
    Guest

    Re: New to me

    Probably best in the module, a standard module, not a worksheet module.

    --
    HTH

    Bob Phillips

    (remove nothere from email address if mailing direct)

    "Striker" <striker3070@qwest.net> wrote in message
    news:uvq2colWGHA.3440@TK2MSFTNGP02.phx.gbl...
    > WOW great response. OK now I am putting a command button to move to the
    > next row and put text from that row into the test boxes. I think I can

    use
    > the offset method to do this, but I need to be careful in case someone has
    > changes the text in the form, I need to copy to the spreadsheet.
    >
    > From reading thru this forum I was thinking about setting a variable

    (bool)
    > to make the form dirty. Perhaps bDirty as booleen. Would this be a global
    > variable in the module, or could it be a global variable in the form?
    >
    >
    >
    > "Striker" <striker3070@qwest.net> wrote in message
    > news:u6LUVxkWGHA.3848@TK2MSFTNGP05.phx.gbl...
    > >I am kind of new to VBA. I picked up a book and will try to figure it all
    > >out. In reading through some of the posts, this board looks like a good
    > >place to ask questions. Please let me know if there is a better one.
    > >
    > > Question. In Excel 2002, I want to load a form that copies text data

    from
    > > a row of cells into a form. So my first question is how do I load the
    > > form I created? What I did is add a module with one sub that just loads
    > > the form into memory, like below....
    > >
    > > Sub LoadForm()
    > > Range("A2").Select
    > > Load frmMain
    > > End Sub
    > >
    > > Then I was thinking about putting code to copy cells of data into text
    > > boxes using the offset method from "A2" in the Form Initialize event.
    > >
    > > I want the user to manually start the form, so am I on the correct track
    > > with where I'm going?
    > >

    >
    >




+ 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