Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Button on User Form to save Data to specific Cell??
I can make my button work this way...
Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Billing Sheet") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'copy data to database With ws .Cells(iRow, 1).Value = Me.txtCoopName.Value End With 'clear the data Me.txtCoopName.Value = "" Me.txtCoopName.SetFocus End Sub But I need the Data to go to a specific Cell rather than the first open row exel finds on the specified sheet.. If I take out... 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row then it gives me an error PLEASE HELP!!!!!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Button on User Form to save Data to specific Cell??
..Cells(3, 2).Value = Me.txtCoopName.Value will write to row 3 column 2, aka B3. HTH. Best wishes Harald "DarnTootn" skrev i melding ... I can make my button work this way... Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Billing Sheet") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'copy data to database With ws .Cells(iRow, 1).Value = Me.txtCoopName.Value End With 'clear the data Me.txtCoopName.Value = "" Me.txtCoopName.SetFocus End Sub But I need the Data to go to a specific Cell rather than the first open row exel finds on the specified sheet.. If I take out... 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row then it gives me an error PLEASE HELP!!!!!!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Button on User Form to save Data to specific Cell??
Thank you ... that does the trick...my best to you
"Harald Staff" wrote: ..Cells(3, 2).Value = Me.txtCoopName.Value will write to row 3 column 2, aka B3. HTH. Best wishes Harald "DarnTootn" skrev i melding ... I can make my button work this way... Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Billing Sheet") 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row 'copy data to database With ws .Cells(iRow, 1).Value = Me.txtCoopName.Value End With 'clear the data Me.txtCoopName.Value = "" Me.txtCoopName.SetFocus End Sub But I need the Data to go to a specific Cell rather than the first open row exel finds on the specified sheet.. If I take out... 'find first empty row in database iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row then it gives me an error PLEASE HELP!!!!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Specific Form by User Login | Excel Discussion (Misc queries) | |||
Data from user form to certain cell | Excel Programming | |||
use a button to open a user form? | Excel Discussion (Misc queries) | |||
A "previous" button on a user form | Excel Discussion (Misc queries) | |||
User Form Button Code | Excel Programming |