creating a macro that will work everyday copying formulas from row to row

gmccray

New Member
Joined
Jan 9, 2009
Messages
16
Hi,
I am trying to turn this macro into code that I can use everyday without having to have to change all the ranges daily. i have a report that has several formulas in in row and each day I need to copy and paste the formulas into the next row. the report is daily and built daily with the previous days data. The report is built for each specific month.

can you help please?

Code:
Sub UpdateNextDay()
'
' UpdateNextDay Macro
' Copy formlulas from row to row in Daily FSG Apps with Leads Report
'


    Range("D24").Select
    Selection.Copy
    Range("D25").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("F24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("F25").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("H24:I24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("H25").Select
    ActiveSheet.Paste
    Range("L24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("L25").Select
    ActiveSheet.Paste
    Range("N24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("N25").Select
    ActiveSheet.Paste
    Range("P24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("P25").Select
    ActiveSheet.Paste
    Range("U24:V24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("U25").Select
    ActiveSheet.Paste
    ActiveWindow.SmallScroll ToRight:=4
    Range("Y24").Select
    ActiveWindow.SmallScroll ToRight:=6
    Range("Y24:AE24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("Y25:AE25").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("AH24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AH25").Select
    ActiveSheet.Paste
    Range("AJ24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AJ25").Select
    ActiveSheet.Paste
    Range("AL24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AL25").Select
    ActiveSheet.Paste
    Range("AQ24").Select
    ActiveWindow.SmallScroll ToRight:=2
    Range("AQ24:AR24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AQ25:AR25").Select
    ActiveSheet.Paste
    Range("AU24").Select
    ActiveWindow.SmallScroll ToRight:=8
    Range("AU24:BA24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("AU25:BA25").Select
    Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("BD24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("BD25").Select
    ActiveSheet.Paste
    Range("BF24").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("BF25").Select
    ActiveSheet.Paste
    ActiveWindow.ScrollColumn = 34
    ActiveWindow.ScrollColumn = 42
    ActiveWindow.ScrollColumn = 1
    ActiveWindow.SmallScroll Down:=-3
End Sub
 
Last edited by a moderator:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Does this do what you want
Code:
Sub chk()
   With Range("D" & Rows.Count).End(xlUp)
      Intersect(.EntireRow.Resize(2), Range("D:D,F:F,H:I,L:L,N:N,P:P,U:V,Y:AE")).FillDown
   End With
End Sub
You'll need to add the rest of the ranges in the same manner
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top