Copy and Paste Macro or Formula

lorenzoc

New Member
Joined
Feb 21, 2013
Messages
26
Hello everyone, thanks for the help. Heres the situation,

I would like a formula or macro that would recognize an answer to a question and populate a group of headings in another sheet.My thought is it would be copy and paste related. Specifically, =If(sheet1A1=2013,then show January 2013, February 2013, March 2013 etc in Sheet 2A1-A120. I would have all these months written out somewhere else to be copy and pasted.

Please let me know if anyone has any thoughts or needs clarification.

thanks so much,

Lorenzo
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try the code below Lorenzo. It creates a new tab and names it the value in A1 and then enters and formats the months/year as you desire. There are certainly more elegant solutions, but this may work.
Sub LorenzocDates()
Dim start As String
start = Cells(1, 1).Value
Sheets.Add
ActiveSheet.Name = start 'Names the new sheet the value that was in A1
Cells(1, 1).Value = "January " & start
Cells(1, 2).Value = "February " & start
Cells(1, 3).Value = "March " & start
Cells(1, 4).Value = "April " & start
Cells(1, 5).Value = "May " & start
Cells(1, 6).Value = "June " & start
Cells(1, 7).Value = "July " & start
Cells(1, 8).Value = "August " & start
Cells(1, 9).Value = "September " & start
Cells(1, 10).Value = "October " & start
Cells(1, 11).Value = "November " & start
Cells(1, 12).Value = "December " & start
'Format Cells
Range("A1:L1").Select
Selection.NumberFormat = "mmmm yyyy"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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