Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
code gone wrong when trying to make an automated form
hello
the problem is that everytime i open my spreadsheet the dialog i created to open at the begining pops up. that is exactly what i want it to do, but i only want to do it once. the reason is that once you open it again after saving you have the popup come up and then you have to enter the information for specific cells again. here is my code that is giving me trouble. the popup doesnt show at all. whether the cell b5 is empty or not. Private Sub Workbook_Open() Dim USRNM As String USRNM = Range("b5").Select If IsNull(USRNM) Then TimeCardInfo.Show End If End Sub here is all the other code for the project. just incase there is something that is causing the problem there. this code is attached to the user form i have created to popup whenever the book is opened. Private Sub Ok_Click() Range("b5").Select ActiveCell.Value = UserName Range("e5").Select ActiveCell.Value = EmployNumber Range("a11").Select ActiveCell.Value = Enterdatebox Range("b8").Select Hide End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the OK button after entering required data!" End If End Sub if anyone can offer a sugestion as to how to make it only popup if the cell b5 is blank that would be great! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
code gone wrong when trying to make an automated form
USRNM = Range("b5").Select
should be USRNM = Range("b5").Value ' or .text??? And check it with: If USRNM = "" Then DawnTreader wrote: hello the problem is that everytime i open my spreadsheet the dialog i created to open at the begining pops up. that is exactly what i want it to do, but i only want to do it once. the reason is that once you open it again after saving you have the popup come up and then you have to enter the information for specific cells again. here is my code that is giving me trouble. the popup doesnt show at all. whether the cell b5 is empty or not. Private Sub Workbook_Open() Dim USRNM As String USRNM = Range("b5").Select If IsNull(USRNM) Then TimeCardInfo.Show End If End Sub here is all the other code for the project. just incase there is something that is causing the problem there. this code is attached to the user form i have created to popup whenever the book is opened. Private Sub Ok_Click() Range("b5").Select ActiveCell.Value = UserName Range("e5").Select ActiveCell.Value = EmployNumber Range("a11").Select ActiveCell.Value = Enterdatebox Range("b8").Select Hide End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the OK button after entering required data!" End If End Sub if anyone can offer a sugestion as to how to make it only popup if the cell b5 is blank that would be great! -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
code gone wrong when trying to make an automated form
Hello
k, will try this thanks! "Dave Peterson" wrote: USRNM = Range("b5").Select should be USRNM = Range("b5").Value ' or .text??? And check it with: If USRNM = "" Then DawnTreader wrote: hello the problem is that everytime i open my spreadsheet the dialog i created to open at the begining pops up. that is exactly what i want it to do, but i only want to do it once. the reason is that once you open it again after saving you have the popup come up and then you have to enter the information for specific cells again. here is my code that is giving me trouble. the popup doesnt show at all. whether the cell b5 is empty or not. Private Sub Workbook_Open() Dim USRNM As String USRNM = Range("b5").Select If IsNull(USRNM) Then TimeCardInfo.Show End If End Sub here is all the other code for the project. just incase there is something that is causing the problem there. this code is attached to the user form i have created to popup whenever the book is opened. Private Sub Ok_Click() Range("b5").Select ActiveCell.Value = UserName Range("e5").Select ActiveCell.Value = EmployNumber Range("a11").Select ActiveCell.Value = Enterdatebox Range("b8").Select Hide End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the OK button after entering required data!" End If End Sub if anyone can offer a sugestion as to how to make it only popup if the cell b5 is blank that would be great! -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
code gone wrong when trying to make an automated form
Hello
you rock! that worked great. i used ".value" and it does exactly what i wanted. thanks so much. :) "Dave Peterson" wrote: USRNM = Range("b5").Select should be USRNM = Range("b5").Value ' or .text??? And check it with: If USRNM = "" Then DawnTreader wrote: hello the problem is that everytime i open my spreadsheet the dialog i created to open at the begining pops up. that is exactly what i want it to do, but i only want to do it once. the reason is that once you open it again after saving you have the popup come up and then you have to enter the information for specific cells again. here is my code that is giving me trouble. the popup doesnt show at all. whether the cell b5 is empty or not. Private Sub Workbook_Open() Dim USRNM As String USRNM = Range("b5").Select If IsNull(USRNM) Then TimeCardInfo.Show End If End Sub here is all the other code for the project. just incase there is something that is causing the problem there. this code is attached to the user form i have created to popup whenever the book is opened. Private Sub Ok_Click() Range("b5").Select ActiveCell.Value = UserName Range("e5").Select ActiveCell.Value = EmployNumber Range("a11").Select ActiveCell.Value = Enterdatebox Range("b8").Select Hide End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the OK button after entering required data!" End If End Sub if anyone can offer a sugestion as to how to make it only popup if the cell b5 is blank that would be great! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automated list form a different source | Excel Discussion (Misc queries) | |||
Percentage help in automated order form | Excel Worksheet Functions | |||
Automated task to present data in a graph form. | Charts and Charting in Excel | |||
Automated task to present data in a graph form. | Charts and Charting in Excel | |||
Automated charting VB code problem | Excel Programming |