cell linked to a sheetname created VBA

roulietta2424

New Member
Joined
Aug 16, 2010
Messages
3
Hi,

The first part of my program is about a solver that creates a new sheet with the same format everytime it runs so the user can keep a trace of different scenarios.

But now i have another sheet called "Data Comparison" and I want to define two cells where the user can add the name of the sheets/scenarios he want to compare. the goal is to calculate different ratios.

All I can do is use this Formula and I had to add manually for each cell.

Worksheets("Data Comparison").Range("C19").Select
ActiveCell.FormulaR1C1 = "=INDIRECT(""'""& R[-8]C[-0] &""'""& ""!""&""C3"")"
Worksheets("Data Comparison").Range("D19").Select
ActiveCell.FormulaR1C1 = "=INDIRECT(""'""& R[-7]C[-1] &""'""& ""!""&""C3"")"
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Why don't you make the DataComparison sheet use indirect function to extract the required data from the 2 sheets under comparison. put the sheet names of the 2 for comparison into cells on DataComparison. Say in A1 and A2, but it could be anywhere. Then either get the code that creates the new sheet to enter the newly created sheet name into A1 on DataComparison and call for the user to specify the sheet it is to be compared with, and put that in A2
 
Upvote 0

Forum statistics

Threads
1,215,151
Messages
6,123,316
Members
449,094
Latest member
Chestertim

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