Copying named cells

amzma

New Member
Joined
Jul 1, 2016
Messages
10
Hi there

I have a spreadsheet that I use to keep helpful formulas in for work that I need to do.

I have made two buttons that calculate two different cells but a specific number, when I am copying it into other workbooks the buttons arent working as it is copying the cells names, for example B18 I have renamed "osi" but when I copy it into a new sheet it reverts back to "b18", is there anyway to keep the name I have made?

Here is the VBA code I have made below;

Sub Macro1()
'
' Macro1 Macro
'

'
Range("owe").Select (this is normally cell B18)
ActiveCell.FormulaR1C1 = "=SUM(R[-5]C*77.5)"
Range("owe").Select
End Sub

Sub Macro2()
'
' Macro1 Macro
'

'
Range("osi").Select (this is normally cell B19)
ActiveCell.FormulaR1C1 = "=SUM(R[-6]C*45)"
Range("osi").Select
End Sub

Any help will be greatly appreciated!

Many thanks.
Amy
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Here is a thread on copying named ranges.

Hi Dave

Thank you for the info, is there a way to copy it without having to manually change the "workbook2" name each time as I copy it into lots of different sheets, all with different names.

Thanks.
Amy
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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