Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Multiple workbook

I am trying to have a cell refer to a work book which can be filled and
cleared with a macro. What i am trying to do is have the path to the
other workbook in a cell.

This is what i have now:

Range("D3").FormulaR1C1 = _
"=IF(RC[-2]='C:\GLEXCEL\" & [H4] &
"LEDGER'!RC[-2],'C:\GLEXCEL\" & [H4] & "LEDGER'!RC[2],0)"
Range("D3").AutoFill Destination:=Range("D3:D123"),
Type:=xlFillDefault
Calculate

Now i want to change that so i have to put the full path in H4 and have
the code just look there but when ever i try that it does not work.

Any ideas anyone?

Thanks,
Arthur

  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Multiple workbook

Hi Leon,

You can't use VBA syntax in cell formulas! Try this simple solution:

In D3 enter =IF($H4<"","C:\GLEXCEL\"&$H4,"")

which will concatenate your path to whatever value is in H4 if it's not
empty. If H4 is empty then it leaves the cell blank. (as in empty string)

This assumes H4 holds the value that you want placed in D3. If you fill
down, the next row (D4) will receive the path + the value in H5, ..and so on.
Is this what you want?

HTH
Regards,
GS

"Leon" wrote:

I am trying to have a cell refer to a work book which can be filled and
cleared with a macro. What i am trying to do is have the path to the
other workbook in a cell.

This is what i have now:

Range("D3").FormulaR1C1 = _
"=IF(RC[-2]='C:\GLEXCEL\" & [H4] &
"LEDGER'!RC[-2],'C:\GLEXCEL\" & [H4] & "LEDGER'!RC[2],0)"
Range("D3").AutoFill Destination:=Range("D3:D123"),
Type:=xlFillDefault
Calculate

Now i want to change that so i have to put the full path in H4 and have
the code just look there but when ever i try that it does not work.

Any ideas anyone?

Thanks,
Arthur


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine worksheets in multiple workbook in one workbook with a macro Sam Commar Excel Discussion (Misc queries) 2 April 2nd 09 01:09 PM
Multiple workbook data imported into single workbook SaipanRick Excel Worksheet Functions 4 June 16th 08 08:22 PM
Automated multiple text files into multiple sheets in one workbook Dr Dan Excel Discussion (Misc queries) 14 November 4th 07 11:32 AM
Combine multiple workbooks into 1 workbook w/ multiple worksheets buffgirl71 Excel Discussion (Misc queries) 1 May 13th 06 12:28 PM
Multiple workbook user's with Master workbook - all password protected Yvon Excel Discussion (Misc queries) 2 March 30th 05 01:34 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"