copy column formulas

lsaari

New Member
Joined
Jul 29, 2020
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
I want to be able to copy formulas in one column to another column without copying the data that is there. I realize I can drag cells, but there are so many I don't want to do that. I have tried copying and pasting "formulas", but the numbers from my original column paste over my numbers in the new column.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
When pasting the formula, are you keeping the data column the same relative position to the formula column?
Can you post an image of your sheet?
 
Upvote 0
I am trying to copy column C to column E and G - but I only want the formulas to copy. I need the data to remain what it is.
 

Attachments

  • excel test.PNG
    excel test.PNG
    43.7 KB · Views: 6
Upvote 0
Do you want to overwrite what is in columns E and G?
Or do you want to only copy it to cells in columns E and G that are blank?

What about when column C is blank?
Do the blank columns contain formulas, or nothing at all?
 
Upvote 0
I do not want to overwrite the actual numbers - except where a formula would be appropriate. (the sub total lines and/or the total lines). I just want to only copy the formulas from one column to the next. I have reports that download to excel, but there are no formulas. I want formulas and the original numbers. So I set up the formulas in the first column and want them in all the columns. i don't want to have to click and drag the cell across the page to get it into the rest of the columns. Am I making sense. I don't know how else to explain it.

See my screen shot I have attached. I made the 485077.84 in column c, line 15 a formula. but the 16930.92 and the 502008.76next to it is not yet a formula, it is just a value. I was imagining a function that would allow me to click all of column c and copy only the formulas to column E. so then the 16930.92 or the 502008.76 would not just be values anymore, but would calculate. If I have to change a number I want the totals to change with it.

Again, I realize i could make a formula and then drag it across but sometimes it is easier to work with one column at a time. the blank columns could be deleted. they just sent to excel that way from my accounting package.
 

Attachments

  • excel test 2.PNG
    excel test 2.PNG
    33.5 KB · Views: 1
Upvote 0
So, is it only the "Total" rows that you want to do this too?
 
Upvote 0
See if this VBA code does what you want:
VBA Code:
Sub MyCopyTotals()

    Dim lr As Long, r As Long
    
    Application.ScreenUpdating = False
    
'   Find last row with data in column A
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    
'   Loop through all rows starting with row 12
    For r = 12 To lr
'       See if column A starts with "Total..."
        If Left(Cells(r, "A"), 5) = "Total" Then
'           Copy formula in column C to columns E and G
            Cells(r, "C").Copy Cells(r, "E")
            Cells(r, "C").Copy Cells(r, "G")
        End If
    Next r

    Application.ScreenUpdating = True
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

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