Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default code problem not working HELP

I am still learning this code stuff so any and all help will be appreciated
with some detail on the code problem I am having. There are 2 problems:

1- I am trying to create a userform where only the form shows when I open
the application. The code I have below opens the application and then opens
the form but the application is still visible, and I cannot get into the
application to make changes or view reports/charts. I don't know if I have
something out of order or missing please advise on the correct code:

In This Workbook I entered the following:

Private Sub Workbook_Open()
Load userform1
userform1.show
Application.visible=False

2. In order to get the workbook visible so I can make changes and view
charts I am going to put a command button on the userform, but I want the
button to be passworded. I want to click on the button and make the
application visible and allow for changes, viewing and printing
charts/reports.

What and where do I add code to view the workbook, and if possible to make
the workbook not visible after I am done with changes? Also I need to know
what to put in place of Sheets("sheet2").select so that the workbook opens
back up
Here is the code for the command button

Private Sub Commandbutton1_Click()
dim PWD as string
PWD = inputbox(prompt:="Enter Password")
if PWD = "xxxxxxxxx" then
Sheets("Sheet2").select
else
msgbox "incorrect password"
End if
End sub
--
BillD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default code problem not working HELP

See if this site helps any:

http://puremis.net/excel/code/063.shtml



"BillD" wrote in message
...
I am still learning this code stuff so any and all help will be appreciated
with some detail on the code problem I am having. There are 2 problems:

1- I am trying to create a userform where only the form shows when I open
the application. The code I have below opens the application and then
opens
the form but the application is still visible, and I cannot get into the
application to make changes or view reports/charts. I don't know if I have
something out of order or missing please advise on the correct code:

In This Workbook I entered the following:

Private Sub Workbook_Open()
Load userform1
userform1.show
Application.visible=False

2. In order to get the workbook visible so I can make changes and view
charts I am going to put a command button on the userform, but I want the
button to be passworded. I want to click on the button and make the
application visible and allow for changes, viewing and printing
charts/reports.

What and where do I add code to view the workbook, and if possible to make
the workbook not visible after I am done with changes? Also I need to know
what to put in place of Sheets("sheet2").select so that the workbook opens
back up
Here is the code for the command button

Private Sub Commandbutton1_Click()
dim PWD as string
PWD = inputbox(prompt:="Enter Password")
if PWD = "xxxxxxxxx" then
Sheets("Sheet2").select
else
msgbox "incorrect password"
End if
End sub
--
BillD



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code not working- repost to further explain problem [email protected] Excel Programming 8 August 29th 06 09:15 PM
Problem with VBA code written in Excel 2002 working in Office 2003 [email protected] Excel Programming 2 July 11th 06 08:44 PM
Code not working GregR Excel Programming 9 July 26th 05 04:46 PM
why this code not working Bernie Deitrick[_2_] Excel Programming 0 September 2nd 03 05:08 PM


All times are GMT +1. The time now is 03:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"