LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default userform question

I am trying to use the code below to enter data into an excel workbook with a
userform. If I click the "Yes" response,(for multiple entries) it will try to
reopen the workbook again. Does anyone have any ideas on how to fix this?
Thanks in advance.


Workbooks.Open Filename:= _
"J:\Personal\ Production Interim Rework Log.xls"
Sheets("BATCH 1").Select
Dim LastRow As Object
Set LastRow = Range("a65536").End(xlUp)

LastRow.Offset(1, 2).Value = TextBox1.Text
LastRow.Offset(1, 4).Value = TextBox2.Text
LastRow.Offset(1, 7).Value = TextBox3.Text
LastRow.Offset(1, 8).Value = TextBox4.Text
LastRow.Offset(1, 9).Value = ComboBox1.Text
LastRow.Offset(1, 5).Value = TextBox6.Text

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
ComboBox1.Text = ""
TextBox6.Text = ""

ComboBox1.SetFocus
Else
Unload Me
End If
End Sub

 
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
UserForm Question Need Help! jfcby[_2_] Excel Programming 2 October 14th 06 03:20 AM
UserForm Question Sharon Excel Programming 7 March 30th 05 05:48 PM
VBA UserForm Question.......Help! Sam Torasco Excel Programming 6 July 19th 04 01:23 PM
Userform question David Goodall Excel Programming 5 May 12th 04 10:18 AM
userform question Rob Bovey Excel Programming 0 August 25th 03 11:43 PM


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

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

About Us

"It's about Microsoft Excel"