Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default 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
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
automated list form a different source Record keeping Excel Discussion (Misc queries) 2 November 21st 08 05:52 PM
Percentage help in automated order form scrapjaci Excel Worksheet Functions 4 April 10th 08 06:47 PM
Automated task to present data in a graph form. luckyguy Charts and Charting in Excel 1 November 3rd 05 12:20 PM
Automated task to present data in a graph form. luckyguy Charts and Charting in Excel 1 November 2nd 05 10:51 PM
Automated charting VB code problem Danimal Excel Programming 1 August 28th 04 07:51 AM


All times are GMT +1. The time now is 08:01 AM.

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"