Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy paste a formula in multiple cells
I dont have consecutive cells ,I have cells like G3, G6, G9... uptil G500 or so
How should I copy paste a formula into these cells without manually selecting all these cells using ctrl key Is there a way to select these cells and copy paste the formula |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy paste a formula in multiple cells
Assuming that the cells are incrementing by 3.... and shCurrent is the name
of your worksheet in question. Here is the code: Dim rSelect As Range Dim strRange As String Dim nRange As Integer strRange = "G3" For nRange = 6 To 500 Step 3 strRange = strRange & ",G" & nRange Next nRange Set rSelect = shCurrent.Range(strRange) shCurrent.Cells(1, 1).Copy rSelect.Select shCurrent.Paste Application.CutCopyMode = False *** One Final Note: I test out the above and find that the 500 is too much for Excel to handle. 174 is the limit. So I suggest that you divide into chunks of 150-loop iterations. That is: For nRange = 6 To 150 Step 3 For nRange = 153 To 300 Step 3 For nRange = 303 To 500 Step 3 "vijaya" wrote: I dont have consecutive cells ,I have cells like G3, G6, G9... uptil G500 or so How should I copy paste a formula into these cells without manually selecting all these cells using ctrl key Is there a way to select these cells and copy paste the formula |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trying to copy and paste line of text into multiple cells | Excel Discussion (Misc queries) | |||
macro copy/paste data from multiple cells to multiple cells | Excel Discussion (Misc queries) | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
Copy paste a formula in multiple cells | Excel Programming | |||
How to copy and paste same formula in multiple cells? | Excel Worksheet Functions |