Help to modify existing Marco

endlessboundless

New Member
Joined
Jan 27, 2011
Messages
33
Hi, hope someone can help.

So the following macro I have, takes values on a list and inputs them 12 times each horizontally across the 'actual' and 'budget' tabs. What I need to change/add is...

1) I would like the macro to first clear those values on the 'actual'/'budget' tab in row C then input the values

2) I would like to input dates (Jan, Feb, Mar....) under each value in row C. Also i need this row (row D) cleared before the 'Jan, Feb....." is populated.

Dim rng As Range
Dim Ray As Variant
Dim Dn As Range
Set rng = Range(Range("C17"), Range("C" & Rows.Count).End(xlUp))
For Each Dn In rng
Ray = Ray & Application.Rept(Dn.Value & ",", 12)
Next Dn
Sheets("Actual").Range("C2").Resize(, rng.Count * 12) = Split(Ray, ",")
Sheets("Budget").Range("C2").Resize(, rng.Count * 12) = Split(Ray, ",")


Thank you in advance!!!

Amit
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

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