Copying a value into multiple cells

chadski778

Active Member
Joined
Mar 14, 2010
Messages
297
Is there code I can use for copying a value in a particular cell into multiple cells. I have literally thousands of cells to copy into so if i used the copy and drag it would take forever. For example, if the value was in cell A1 and I wanted it copied into cells A2:A40000

Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Could you modify that so it is the Active cell that is copied and pasted into all the cells immediately below it in the same column?
 
Upvote 0
Could you modify that so it is the Active cell that is copied and pasted into all the cells immediately below it in the same column?

Assuming the active cell is A1,

Sub CopyAndPaste()
ActiveCell.Copy Range("A2:A4000")
End Sub

Adjust range as desired.
 
Upvote 0
When you say 'all the cells below it' do you mean to to last row on the sheet or the last used row in a particular column?
 
Upvote 0
Sorry I mean all the cells to the last used row in the column of the active cell
How about this macro then...
Code:
Sub CopyActiveCellDown()
  Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Value = ActiveCell.Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

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