Find next empty row not working.

mudflap

New Member
Joined
Sep 26, 2009
Messages
34
I'm trying to write this form and everything is working good except it is not finding the next empty row. It is just overwriting the data from previous run. I had tried a couple different ways to find next row but no success! And I'm trying to make any sheet active when I run this form. It only runs with the sheet that I specified in the code. Is there a way to fix my problems?

Thanks for looking mudflap!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Private Sub CBok_Click()
'Find next row on data sheet

nextrow = Worksheets("2011").Cells(Rows.Count, 1).End(xlUp) + 5


' Write the values from this form to that row
With Worksheets("2011")
.Cells(nextrow, 1).Value = Me.TBinvoicedate
.Cells(nextrow, 2).Value = Me.TBinvoicenumber
.Cells(nextrow, 3).Value = Me.TBjobnumber
.Cells(nextrow, 4).Value = Me.TBinvoiceamount

End With

'Unload the form
Unload Me


End Sub
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top