SirBarnabus
New Member
- Joined
- Jul 16, 2013
- Messages
- 5
Dear Macro-gurus,
I have data entry on Sheet1. The user fills in the answers as they go, and at the bottom of the questionnaire, there is a button marked "Submit".
This button intends to trigger a macro, which copies all of the answers, pastes it to the next available column in Sheet2 and clears all of the answers in Sheet1.
On Sheet2, the same setup is used as Sheet1, but I also have a row for the data entry record number. I have had this at the top and bottom of the sheet, thinking that might be throwing the macro off, but moving it doesnt seem to help.
This is what I have so far:
Sub Submit()
'
' Submit Macro
'
'
Range("F6:F58").Select
Selection.Copy
Sheets("Sheet1").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Sheets("Sheet2").Select
ActiveWindow.SmallScroll Down:=0
Application.CutCopyMode = False
Selection.ClearContents
End Sub
To illustrate, say I have cells F6 - F58 filled with answers. By hitting submit, I want this to copy the cells to column D (cells D6 - D58) the first time, then E, then F and so on. I've googled endlessly, but can't seem to find the answer and/or don't know how to adjust the code so it will work for my example. Instead it seems to put the data in really random places - skipping down 50 rows or 10 columns across. I don't know if this has to do with resetting the macro, but while testing I have deleted the entered data (ie. cells D6-D58 are blank), yet this doesn't seem to help the issue either.
Any help would be greatly appreciated!
I have data entry on Sheet1. The user fills in the answers as they go, and at the bottom of the questionnaire, there is a button marked "Submit".
This button intends to trigger a macro, which copies all of the answers, pastes it to the next available column in Sheet2 and clears all of the answers in Sheet1.
On Sheet2, the same setup is used as Sheet1, but I also have a row for the data entry record number. I have had this at the top and bottom of the sheet, thinking that might be throwing the macro off, but moving it doesnt seem to help.
This is what I have so far:
Sub Submit()
'
' Submit Macro
'
'
Range("F6:F58").Select
Selection.Copy
Sheets("Sheet1").Select
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
Sheets("Sheet2").Select
ActiveWindow.SmallScroll Down:=0
Application.CutCopyMode = False
Selection.ClearContents
End Sub
To illustrate, say I have cells F6 - F58 filled with answers. By hitting submit, I want this to copy the cells to column D (cells D6 - D58) the first time, then E, then F and so on. I've googled endlessly, but can't seem to find the answer and/or don't know how to adjust the code so it will work for my example. Instead it seems to put the data in really random places - skipping down 50 rows or 10 columns across. I don't know if this has to do with resetting the macro, but while testing I have deleted the entered data (ie. cells D6-D58 are blank), yet this doesn't seem to help the issue either.
Any help would be greatly appreciated!