Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple destination cells for data entry
Hi,
I want data entered on a user form to be sent to cells on two worksheets. The following code is what I have for sending data to one worksheet. How alter the code so data is sent to sheet 1 and sheet 2 ? Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Worksheets("Sheet1").Range("A6000").End(xlUp) If Me.ComboBox1.Value < "" And Not IsNull(Me.ComboBox1) And Me.TextBox1.Value < "" And Not IsNull(Me.TextBox1) Then LastRow.Offset(2, 0).Value = ComboBox1.Text LastRow.Offset(2, 3).Value = TextBox1.Text End If End Sub -------------- Regards gregork |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple destination cells for data entry
Gregork
Add the lines Dim anotherrow as object Set anotherrow = Worksheets("Sheet2").Range("A6000").End(xlUp) anotherrow.Offset(2, 0).Value = ComboBox1.Text anotherrow.Offset(2, 3).Value = TextBox1.Text Adjust according to the requirements to select the row in sheet2. Tony ----- gregork wrote: ----- Hi, I want data entered on a user form to be sent to cells on two worksheets. The following code is what I have for sending data to one worksheet. How alter the code so data is sent to sheet 1 and sheet 2 ? Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Worksheets("Sheet1").Range("A6000").End(xlUp) If Me.ComboBox1.Value < "" And Not IsNull(Me.ComboBox1) And Me.TextBox1.Value < "" And Not IsNull(Me.TextBox1) Then LastRow.Offset(2, 0).Value = ComboBox1.Text LastRow.Offset(2, 3).Value = TextBox1.Text End If End Sub -------------- Regards gregork |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple destination cells for data entry
Hi Tony,
Many thanks for the reply your solution works perfectly. Could you tell me if it is possible to include in this event , a code that will copy data from cells on sheet1 to sheet2 that are not on the user form. Do I need to do this in a different event ? I would use lookups but the data in sheet 1 is going to be deleted so I need a record of it in sheet 2. Kind Regards gregork "acw" wrote in message ... Gregork Add the lines Dim anotherrow as object Set anotherrow = Worksheets("Sheet2").Range("A6000").End(xlUp) anotherrow.Offset(2, 0).Value = ComboBox1.Text anotherrow.Offset(2, 3).Value = TextBox1.Text Adjust according to the requirements to select the row in sheet2. Tony ----- gregork wrote: ----- Hi, I want data entered on a user form to be sent to cells on two worksheets. The following code is what I have for sending data to one worksheet. How alter the code so data is sent to sheet 1 and sheet 2 ? Private Sub CommandButton1_Click() Dim LastRow As Object Set LastRow = Worksheets("Sheet1").Range("A6000").End(xlUp) If Me.ComboBox1.Value < "" And Not IsNull(Me.ComboBox1) And Me.TextBox1.Value < "" And Not IsNull(Me.TextBox1) Then LastRow.Offset(2, 0).Value = ComboBox1.Text LastRow.Offset(2, 3).Value = TextBox1.Text End If End Sub -------------- Regards gregork |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple data entry with multiple results | Excel Worksheet Functions | |||
How to parse long spaced entry into multiple cells??? | Excel Worksheet Functions | |||
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing | Excel Discussion (Misc queries) | |||
Cell Entry That Locks Selected Cells From Any Data Entry. | Excel Worksheet Functions | |||
data entry on multiple worksheets | Excel Discussion (Misc queries) |