I am new to VBA code, and with limited knowledge i try to construct some VBA code for a simple user form to worksheet data input.
so I have a few text boxes that the user enters data into, and then the VBA code pastes the data onto the worksheet row by row, meaning that every time data is entered in the user form, my code has to look for the last row of data then offset one row and paste the data there and for some reason my code always pastes the data on the same row (in the 4th row).
can someone please take a look at the code and figure out what I'm doing wrong?
here is the code:
Dim NextAvailable as long
NextAvailable = ClubLevelMove
Sheets("database").Select
Cells(NextAvailable, 11) = YearTXTBX.Text
Cells(NextAvailable, 12) = ChairmensTXTBX.Text
Cells(NextAvailable, 13) = PresidentsTXTBX.Text
Cells(NextAvailable, 14) = ExecutiveTXTBX.Text
Cells(NextAvailable, 15) = LeadersClubTXTBX.Text
end sub
Function ClubLevelMove()
ClubLevelMove = Cells(1, 11).End(xlDown).Offset(1, 0).Row
End Function
I'd greatly appreciate your help guy's and gals.
so I have a few text boxes that the user enters data into, and then the VBA code pastes the data onto the worksheet row by row, meaning that every time data is entered in the user form, my code has to look for the last row of data then offset one row and paste the data there and for some reason my code always pastes the data on the same row (in the 4th row).
can someone please take a look at the code and figure out what I'm doing wrong?
here is the code:
Dim NextAvailable as long
NextAvailable = ClubLevelMove
Sheets("database").Select
Cells(NextAvailable, 11) = YearTXTBX.Text
Cells(NextAvailable, 12) = ChairmensTXTBX.Text
Cells(NextAvailable, 13) = PresidentsTXTBX.Text
Cells(NextAvailable, 14) = ExecutiveTXTBX.Text
Cells(NextAvailable, 15) = LeadersClubTXTBX.Text
end sub
Function ClubLevelMove()
ClubLevelMove = Cells(1, 11).End(xlDown).Offset(1, 0).Row
End Function
I'd greatly appreciate your help guy's and gals.
Last edited: