View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
cj2k2k cj2k2k is offline
external usenet poster
 
Posts: 18
Default show worksheet along with form

I tried both suggestion but still have the same issue. After doing more
research, I learned that the property on my form called ShowModal need to be
set to False. This works, I can move my form out of the way and observe the
data go into the cells as I complete the form. The "scroll:=true" works
great.
Thank you, Dave.

"Dave Peterson" wrote:

If you just want a worksheet active when the form appears, you can select that
worksheet (well, if that workbook is the activeworkbook).

Private Sub CommandButton1_Click()
'Import data to sheet3
Call OpenDataFile
'Show sheet2 and get user info
Call OpenfrmUserForm
worksheets("sheet2").select
'or you can use:
'application.goto worksheets("sheet2").range("a1"),scroll:=true
'Show Sheet2 and open appropriate form to match the data imported
Call SelectForm
End Sub



cj2k2k wrote:

No, the user does not enter anything directly into sheet2. All the sheet 2
data is obtained with the forms. I wanted to make it as user friendly as
possible. I did not want to risk the user enter the wrong information into
wrong cells.
If I run the forms independent of the mentioned command button, they work
fine (sheet2 in the background of the form). How else can I run these macros
in that order without grouping then in the command button or is there another
way?
I used to run the macro automatically when the file was opened, which worked
but I wanted to give the user the option to start it.

"Dave Peterson" wrote:

Do you want the user to be able to do stuff to sheet2?

If yes, then how about using two different macros.

Run the first, then stop.
let the user do what needs to be done
then have them start the second (with a second button)

cj2k2k wrote:

I figured out that it is my initial command button which is locking
everything up.
This command button is what runs all the macros. This is the code:

Private Sub CommandButton1_Click()
'Import data to sheet3
Call OpenDataFile
'Show sheet2 and get user info
Call OpenfrmUserForm
'Show Sheet2 and open appropriate form to match the data imported
Call SelectForm
End Sub

It appears that once I run this macro with a command button on my workbook,
it does not break out of it until it is done. This macro inputs my data and
opens 2 forms. How do I get it to display sheet2 before it opens the 2 forms?

"cj2k2k" wrote:

I have a workbook with several sheets and several forms. I'm having trouble
getting the appropriate worksheet to show when its related form is selected.
I have a commandbutton with an inital macro that imports my data into
sheet3. A form opens, but sheet3 is still in the background. I want sheet3
to close and before the form opens, I want to have sheet2 activated.
What I'm trying to accomplish is...
As the user inputs data into the form, to show worksheet in the background.
So the user can see where the data is going in. Is there a way to always
display cells where the data is being entered from the form as the form is
being completed?

--

Dave Peterson


--

Dave Peterson