Forum Discussion
DezExcelQuestions
Dec 22, 2021Copper Contributor
macro for cutting and pasting values
Hello! I am very new to VBA and Macros in general, so any feedback is greatly appreciated! I am essentially trying to make a title page for my workbook. I would like there to be a button labeled "s...
- Dec 22, 2021
First off I seriously doubt you can't do this using simple cell formula(s). If needed you could fill ranges or individual cells and don't use ranges to start with (i.e. no spill possible). Do you realize that you are starting with 5 cells and pasting into 4 cells (maybe that is why you have spill error?).
As for easier VBA code:
ThisWorkbook.Sheets("copyFromSheet").Range("F2:J2").copy ThisWorkbook.Sheets("Paste data1").range("A13:D13")note the above is all 1 line with a single space (i.e. RANGE.copy DESTINATION )
HansVogelaar
Dec 22, 2021MVP
Can you tell us:
- Which cells on the Title Page sheet do you want to copy?
- Where do you want to copy them to?
The macro that you posted doesn't provide a real clue: F2:J2 consists of 5 cells, but A13:D13 only 4 cells, so you can't copy one to the other...