I am trying to copy values from "Formulas" , B2:O2 and paste them into cells on "Summary"
The range on "Summary" will vary. It will always start with B2.
The end depends on how many values are in column A.
The current keystrokes are:
1) End down in column A
2) Right arrow, to navigate to column B
3) Shift -> End -> up arrow -> down arrow, to highlight all column B cells with values in column A without the header row 1
4) Paste
The code below is the result of the full recorded macro. It is not dynamic, but using the relative reference seemed to be worse.
How can we achieve the results we are looking for?
Thank you... John
' This copies the formulas from Formulas to Summary
Sheets("Formulas").Select Range("B2:O2").Select Selection.Copy Sheets("Summary").Select Range("A2").Select Selection.End(xlDown).Select Range("B3712").Select Range(Selection, Selection.End(xlUp)).Select Range("B2:B3712").Select Range("B3712").Activate ActiveSheet.Paste
Last edited by pike; 02-04-2011 at 06:35 PM. Reason: add code tags for newbie PM warning
hi jbrad627
welcome to the forum
this copies the "B2:O2" and pastes it to the last row in summary sheetSheets("Formulas").Range("B2:O2").Copy Destination:=Sheets("Summary").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
regards pike
If the solution helped please donate here to the RSPCA
Sites worth visiting;
J&R Solutions - royUK
AJP Excel Information - Andy Pope
Spreadsheet Toolbox
VBA for smarties - snb
Pike, thank you for the reply. I tested the code and it is not exactly what we need for this, but I can use it in another project, so thanks.
For this one, sorry if my original post was confusing. I will try to be a little clearer.
There is a previous process that deletes everything from each sheet but the header.
Then another process pastes in the day's values into column a on Summary.
The number of records can vary.
One time it might be from A2:A3108, the next it might be from A2:A3200, and then A2:A3000, etc.
We now need to select and copy the formulas on Formulas B2:O2 to the rows with values in Summary, column a.
In the above examples, one time the range would be B2:B3108, then B2:B3200 and then B2:B3000, etc.
It always starts with B2, however the ending row varies.
Thank you
John
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks