I have the code below which captures my data onto a the sheet, and works fine when there is already data in the spreadsheet;
However when a new sheet is added, and I try to enter the data it skips the first row, this could normally be ignored as the first row is not that important, however, I also have a piece of code that copies all the data in column "A" to be pasted into an e-mail as required. The code below is what I use to do this;
When I use this code on a separate form, it skips out only selects the top two cells in column "A", I'm not sure what would be easier, to edit the select and copy code, or to edit the data entry code....or in the worst case scrap it all and write something different?
Thanks
Code:
Private Sub btn_Add_Click()
Dim ws As Worksheet
Set ws = ActiveSheet ' change for the worksheet you want data to go to
Set rngNext = ws.Range("A" & Rows.Count).End(xlUp).Offset(1)
rngNext.Value = txt_CompanyName.Value
Set rngNext = ws.Range("B" & Rows.Count).End(xlUp).Offset(1)
rngNext.Value = txt_Notes.Value
Unload Me
frm_AddToWaitingList.Show
End Sub
However when a new sheet is added, and I try to enter the data it skips the first row, this could normally be ignored as the first row is not that important, however, I also have a piece of code that copies all the data in column "A" to be pasted into an e-mail as required. The code below is what I use to do this;
Code:
Private Sub cmb_Airline_Change()
Sheets(cmb_Airline.Value).Select
With Range("A1")
Range(.Cells(1, 1), .End(xlDown)).Select
End With
End Sub
Private Sub CommandButton1_Click()
Selection.Copy
End Sub
When I use this code on a separate form, it skips out only selects the top two cells in column "A", I'm not sure what would be easier, to edit the select and copy code, or to edit the data entry code....or in the worst case scrap it all and write something different?
Thanks
