My macro knowledge is limited to recording keystrokes. I need a macro that will copy the first line of a table to the next blank line in the table as values. Sounds simple enough, but needs code to be written, as it won’t work with a recorded macro. I feel like I’m almost there, but without any code/syntax knowledge, I could also be miles away from the answer. (I have copied bits and pieces from spreadsheetpage.com, but he doesn’t explain simple syntax enough.)
The other problem I’m having is that the buttons I have attached the macros to won’t work since I’ve saved the file to a disk. I get a message saying that another file with the same name is already open.(which is not the case) How can I fix this? The macro will run in the VBA editor.
here is what I’ve got so far: (I get a syntax error at the line that should copy and paste to the blank line below
Sub enterdata()
‘
‘ enterdata Macro
‘ Macro recorded 13/08/2008 by Marjorie McDonald
‘
‘ Keyboard Shortcut: Ctrl+d
‘Copies the data entered in the first row as values in the next blank row
‘
‘
‘
‘ go to database sheet
‘start at the currently selected cell
Sheets(“Database”).Select
x = ActiveCell.Row
‘copy and paste this row as values to the next blank row below
Range(ActiveCell, ActiveCell.End(xlToRight)).Select.Copy _
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
‘Next Blank Cell Below
ActiveCell.Offset(1, 0).Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Loop
End Sub
Thanks so much for any suggestions!