Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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
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
Open Specific Form by User Login Bowtie63 Excel Discussion (Misc queries) 1 November 30th 07 12:21 AM
Data from user form to certain cell parteegolfer Excel Programming 4 March 22nd 06 05:13 PM
use a button to open a user form? Hru48 Excel Discussion (Misc queries) 1 September 1st 05 07:41 PM
A "previous" button on a user form Anthony Slater Excel Discussion (Misc queries) 3 November 29th 04 05:57 PM
User Form Button Code Debs Excel Programming 1 February 26th 04 12:13 PM


All times are GMT +1. The time now is 03:22 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"