Macro to Paste

zaska

Well-known Member
Joined
Oct 24, 2010
Messages
1,046
Hi all

I need a macro to paste the following in Column A

Shar12
Ghar13
Bhar14
Lhar15

Thank you
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I have a feeling that you are giving an oversimplified example, but to answer your question based off the information given:

Code:
Range("A1").Value = "Shar12"
Range("A2").Value = "Ghar13"
Range("A3").Value = "Bhar14"
Range("A4").Value = "Lhar15"

You can also try recording a macro using Excel's built in macro recorder.
 
Upvote 0
Thank you

I tried using macro recorder too and it was fun to learn

Can we simply this code in single line?

Have a nice day
 
Upvote 0
Or maybe

Code:
Sub test()
Range("A1:A4").Value = Application.Transpose(Array("Shar12", "Ghar13", "Bhar14", "Lhar15"))
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,911
Members
452,949
Latest member
beartooth91

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