Macro Button needed for this function

chaju

Board Regular
Joined
Mar 24, 2002
Messages
82
Thanks to those who take a look at this and help!

Suppose the file consists of 2 worksheets

For the both sheets:
Cell A1 have date: 25-Mar-02

Can I have a Macro button so that it inputs (when pressed) this formula into Cell C1 (BOTH Sheets): =C:test[Valuation 25-Mar-02.xls]Ingenium'!$E$11

Note: the date within the file name corresponds to the date in Cell A1 for both sheet.

Suppose both sheet's Column A has already been filled with date. The next step I wish the macro to do is whenever I press the button it will fill the formula mention above into C2 (for both sheets). I must ensure Cell C2 formula (in both sheets)have the file name with the date correspond to their sheet's Cell A2's date.

when I press the button it will do the same to cell C3 with both formula reading the dates in cell A3 (for both sheets)

As I am very new to macro Please asist step by step of how to create a macro button and where to put the VB code...

Many Many Many thanks to the helper,,,
Deeply appreciated
This message was edited by chaju on 2002-03-27 00:03
This message was edited by chaju on 2002-03-27 01:45
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi chaju
I do not understand exactly waht it is you are trying to do?
Please repost with more details...
Thanks
Tom
 
Upvote 0
I have edit the content of the problem.. see if you can understand it this time.. thanks
 
Upvote 0
Sorry, I
still do not understand.
Why not just copy and paste doen column C?
I hope someone else can help you.
Tom
 
Upvote 0
Run this macro when stading in the cell with the date. The cell next to it will then reference to the actual valuationworkbook

Sub test100()
Dim sBook, sFilePath As String
sBook = "[Valuation " & ActiveCell.Text & ".xls]Ingenium'!$E$11"
sFilePath = "C:test"
ActiveCell.Offset(0, 1).Value = "='" & sFilePath & sBook
End Sub

Regards Tommy
 
Upvote 0
Hi
Disregard my last post. I did post a temporary sub.
This one, I hope, will do what you ask for.

Sub test101()
Dim sBook, sFilePath As String
R = ActiveCell.Row
sBook = "[Valuation " & Cells(R, 1).Value & ".xls]Ingenium'!$E$11"
sFilePath = "C:test"
Sheets(1).Cells(R, 3).Formula = "='" & sFilePath & sBook
Sheets(2).Cells(R, 3).Formula = "='" & sFilePath & sBook
ActiveCell.Offset(1, 0).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,025
Members
448,543
Latest member
MartinLarkin

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