PasteSpecial value . . . . very urgent

  • Thread starter Thread starter Legacy 246103
  • Start date Start date
L

Legacy 246103

Guest
Hi,

This code was meant to populate 110 rows. Now, I want a code to populate 15000 cells. If I write in this manner, it says the code is too long to execute. Please suggest an alternative. . This is super urgent.

---------------------------------------------------------------------
Sub AjantaWall()
'
' LD Macro
'
' Keyboard Shortcut: Ctrl+q
'
Application.ScreenUpdating = False
Range("F3").Copy
Range("M2").PasteSpecial Paste:=xlValues
Range("M3").PasteSpecial Paste:=xlValues
Range("M4").PasteSpecial Paste:=xlValues
Range("M5").PasteSpecial Paste:=xlValues
Range("M6").PasteSpecial Paste:=xlValues
Range("M7").PasteSpecial Paste:=xlValues
Range("M8").PasteSpecial Paste:=xlValues
Range("M9").PasteSpecial Paste:=xlValues
Range("M10").PasteSpecial Paste:=xlValues
Range("M11").PasteSpecial Paste:=xlValues
Range("M12").PasteSpecial Paste:=xlValues
Range("M13").PasteSpecial Paste:=xlValues
Range("M14").PasteSpecial Paste:=xlValues
Range("M15").PasteSpecial Paste:=xlValues
Range("M16").PasteSpecial Paste:=xlValues
Range("M17").PasteSpecial Paste:=xlValues
Range("M18").PasteSpecial Paste:=xlValues
Range("M19").PasteSpecial Paste:=xlValues
Range("M20").PasteSpecial Paste:=xlValues
Range("M21").PasteSpecial Paste:=xlValues
Range("M22").PasteSpecial Paste:=xlValues
Range("M23").PasteSpecial Paste:=xlValues
Range("M24").PasteSpecial Paste:=xlValues
Range("M25").PasteSpecial Paste:=xlValues
Range("M26").PasteSpecial Paste:=xlValues
Range("M27").PasteSpecial Paste:=xlValues
Range("M28").PasteSpecial Paste:=xlValues
Range("M29").PasteSpecial Paste:=xlValues
Range("M30").PasteSpecial Paste:=xlValues
Range("M31").PasteSpecial Paste:=xlValues
Range("M32").PasteSpecial Paste:=xlValues
Range("M33").PasteSpecial Paste:=xlValues
Range("M34").PasteSpecial Paste:=xlValues
Range("M35").PasteSpecial Paste:=xlValues
Range("M36").PasteSpecial Paste:=xlValues
Range("M37").PasteSpecial Paste:=xlValues
Range("M38").PasteSpecial Paste:=xlValues
Range("M39").PasteSpecial Paste:=xlValues
Range("M40").PasteSpecial Paste:=xlValues
Range("M41").PasteSpecial Paste:=xlValues
Range("M42").PasteSpecial Paste:=xlValues
Range("M43").PasteSpecial Paste:=xlValues
Range("M44").PasteSpecial Paste:=xlValues
Range("M45").PasteSpecial Paste:=xlValues
Range("M46").PasteSpecial Paste:=xlValues
Range("M47").PasteSpecial Paste:=xlValues
Range("M48").PasteSpecial Paste:=xlValues
Range("M49").PasteSpecial Paste:=xlValues
Range("M50").PasteSpecial Paste:=xlValues
Range("M51").PasteSpecial Paste:=xlValues
Range("M52").PasteSpecial Paste:=xlValues
Range("M53").PasteSpecial Paste:=xlValues
Range("M54").PasteSpecial Paste:=xlValues
Range("M55").PasteSpecial Paste:=xlValues
Range("M56").PasteSpecial Paste:=xlValues
Range("M57").PasteSpecial Paste:=xlValues
Range("M58").PasteSpecial Paste:=xlValues
Range("M59").PasteSpecial Paste:=xlValues
Range("M60").PasteSpecial Paste:=xlValues
Range("M61").PasteSpecial Paste:=xlValues
Range("M62").PasteSpecial Paste:=xlValues
Range("M63").PasteSpecial Paste:=xlValues
Range("M64").PasteSpecial Paste:=xlValues
Range("M65").PasteSpecial Paste:=xlValues
Range("M66").PasteSpecial Paste:=xlValues
Range("M67").PasteSpecial Paste:=xlValues
Range("M68").PasteSpecial Paste:=xlValues
Range("M69").PasteSpecial Paste:=xlValues
Range("M70").PasteSpecial Paste:=xlValues
Range("M71").PasteSpecial Paste:=xlValues
Range("M72").PasteSpecial Paste:=xlValues
Range("M73").PasteSpecial Paste:=xlValues
Range("M74").PasteSpecial Paste:=xlValues
Range("M75").PasteSpecial Paste:=xlValues
Range("M76").PasteSpecial Paste:=xlValues
Range("M77").PasteSpecial Paste:=xlValues
Range("M78").PasteSpecial Paste:=xlValues
Range("M79").PasteSpecial Paste:=xlValues
Range("M80").PasteSpecial Paste:=xlValues
Range("M81").PasteSpecial Paste:=xlValues
Range("M82").PasteSpecial Paste:=xlValues
Range("M83").PasteSpecial Paste:=xlValues
Range("M84").PasteSpecial Paste:=xlValues
Range("M85").PasteSpecial Paste:=xlValues
Range("M86").PasteSpecial Paste:=xlValues
Range("M87").PasteSpecial Paste:=xlValues
Range("M88").PasteSpecial Paste:=xlValues
Range("M89").PasteSpecial Paste:=xlValues
Range("M90").PasteSpecial Paste:=xlValues
Range("M91").PasteSpecial Paste:=xlValues
Range("M92").PasteSpecial Paste:=xlValues
Range("M93").PasteSpecial Paste:=xlValues
Range("M94").PasteSpecial Paste:=xlValues
Range("M95").PasteSpecial Paste:=xlValues
Range("M96").PasteSpecial Paste:=xlValues
Range("M97").PasteSpecial Paste:=xlValues
Range("M98").PasteSpecial Paste:=xlValues
Range("M99").PasteSpecial Paste:=xlValues
Range("M100").PasteSpecial Paste:=xlValues
Range("M101").PasteSpecial Paste:=xlValues
Range("M102").PasteSpecial Paste:=xlValues
Range("M103").PasteSpecial Paste:=xlValues
Range("M104").PasteSpecial Paste:=xlValues
Range("M105").PasteSpecial Paste:=xlValues
Range("M106").PasteSpecial Paste:=xlValues
Range("M107").PasteSpecial Paste:=xlValues
Range("M108").PasteSpecial Paste:=xlValues
Range("M109").PasteSpecial Paste:=xlValues
Range("M110").PasteSpecial Paste:=xlValues
Range("M111").PasteSpecial Paste:=xlValues




Application.ScreenUpdating = True


Range("A1").Select


End Sub


Thanks
Arunabha
 
Woohoooooooo. . . . .

Yes. .Yes. .Yes. .Yes. .Yes. .Yes. .Yes. .Yes. .

You have solved my problem.......THANK A TON....

Can you please explain a bit how to read the code for understanding.....I am an infant in VBA
You have 4 different proposed code solutions... which one were you referring to in your message?
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
You have 4 different proposed code solutions... which one were you referring to in your message?

The following code has solved my issue.....a huge thank you

Now, can you please help me to read the code...I am toooooooo new to programming.


Sub AjantaWall()'For I = 2 To 15000 Step 1 Cells(I, 13).Value = Range("F3").ValueNext IEnd Sub</pre>
 
Upvote 0
Sub Respondent()


Application.ScreenUpdating = False




For i = 2 To 10 Step 1
Cells(i, 2).Value = Range("C2").Value
Next i


Application.ScreenUpdating = True


End Sub


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Hi,


Your solution provided me the way. Now, I want two more things to happen:


Firstly, I want the existing code for choosing the 10 nos., should give me unique selections only. So, that one number should get repeatedly picked up.


Secondly, can we include the Rand ( {=INDEX(A2:A26,ROUND(RAND()*COUNTA(A2:A26),0))}formula in the existing code with an option to select the range.


Please have a look and advice code.


Appreciate your extended help & support.


Thanks
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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