+ Reply to Thread
Results 1 to 3 of 3

excel form activation in macro?

  1. #1
    dr chuck
    Guest

    excel form activation in macro?

    I have learned how to activate a form to fill in data that starts in A1. I
    would like to be able to place my data table at another location (ie c25:h50)
    and activate the form to fill it.

    The syntax below opens a form that is located at A1... I tried making the
    range of my data table be at c25:h50 using a... " range ("c25:h50").select"
    .... statement and the form always defaults to what is at A1?

    Private Sub CommandButton1_Click()
    Range("A1").Select
    ShowDataForm
    End Sub

    Also does the form that im using have to be on the same page as the data
    table that im filling?


    --
    dr chuck


  2. #2
    NickHK
    Guest

    Re: excel form activation in macro?

    A userform is not associated with a particular range or worksheet for that
    matter.
    Userform.StartUpPosition gives you a few built in options.
    If you want it in a particular position, set StartUpPosition to manual and
    move it yourself.
    Bear in mind that you will have to do some calculation to get the
    measurements correct, as the Range.Top is "The distance from the top edge of
    row 1 to the top edge of the range" whilst the userform.Top is absolute on
    the screen.

    NickHK

    "dr chuck" <drchuck@discussions.microsoft.com> wrote in message
    news:9F933E71-96F9-46D9-95D9-46D89B32EF8E@microsoft.com...
    > I have learned how to activate a form to fill in data that starts in A1. I
    > would like to be able to place my data table at another location (ie

    c25:h50)
    > and activate the form to fill it.
    >
    > The syntax below opens a form that is located at A1... I tried making the
    > range of my data table be at c25:h50 using a... " range

    ("c25:h50").select"
    > ... statement and the form always defaults to what is at A1?
    >
    > Private Sub CommandButton1_Click()
    > Range("A1").Select
    > ShowDataForm
    > End Sub
    >
    > Also does the form that im using have to be on the same page as the data
    > table that im filling?
    >
    >
    > --
    > dr chuck
    >




  3. #3
    Tim Marsh
    Guest

    Re: excel form activation in macro?

    my understanding is that you currently have a userform which sends data to
    cell A1 and you want it instead to send data to cell C25 to H50.

    your code below does not control where the data from the userform goes; that
    will be controlled by the userform itself. For example, if you have an 'OK'
    button on the userform, open the userform in the editor and double click the
    'OK' button and it should show any code relating to that button; that is
    where i would normally place the code which tells the userform where to put
    the data (in your case, it sounds like you are telling it to go to cell A1
    somewhere in teh userform)

    hth,

    tim

    "dr chuck" <drchuck@discussions.microsoft.com> wrote in message
    news:9F933E71-96F9-46D9-95D9-46D89B32EF8E@microsoft.com...
    >I have learned how to activate a form to fill in data that starts in A1. I
    > would like to be able to place my data table at another location (ie
    > c25:h50)
    > and activate the form to fill it.
    >
    > The syntax below opens a form that is located at A1... I tried making the
    > range of my data table be at c25:h50 using a... " range
    > ("c25:h50").select"
    > ... statement and the form always defaults to what is at A1?
    >
    > Private Sub CommandButton1_Click()
    > Range("A1").Select
    > ShowDataForm
    > End Sub
    >
    > Also does the form that im using have to be on the same page as the data
    > table that im filling?
    >
    >
    > --
    > dr chuck
    >




+ 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