Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Workbook formula in a macro

I have a macro that opens another spreadsheet (spreadsheet B).
This second spreadsheet is named: "Projections 2006".

I create a var called WB2 which contains the name of this spreadsheet:
WB2 = ActiveWorkbook.Name

The macro then does some sorting and formatting on this spreadsheet.
I now want to add a formula in Spreadsheet A that points to a specific cell
in spreadsheet B (wb2)
I've tried several variations of the formula below and nothing works.

ActiveCell.FormulaR1C1 = "='[wb2]projections'!R3C5"

Can someone point me in the right direction?

Thanks,
El Bee
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Workbook formula in a macro

How about something like this?

Activecell.value = workbooks(wb2).sheets("projections").Range("E3").f ormula

Regards,
Paul

"El Bee" wrote in message
...
I have a macro that opens another spreadsheet (spreadsheet B).
This second spreadsheet is named: "Projections 2006".

I create a var called WB2 which contains the name of this spreadsheet:
WB2 = ActiveWorkbook.Name

The macro then does some sorting and formatting on this spreadsheet.
I now want to add a formula in Spreadsheet A that points to a specific
cell
in spreadsheet B (wb2)
I've tried several variations of the formula below and nothing works.

ActiveCell.FormulaR1C1 = "='[wb2]projections'!R3C5"

Can someone point me in the right direction?

Thanks,
El Bee



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Workbook formula in a macro

THANKS Pual; that did the trick!!!!!


"PCLIVE" wrote:

How about something like this?

Activecell.value = workbooks(wb2).sheets("projections").Range("E3").f ormula

Regards,
Paul

"El Bee" wrote in message
...
I have a macro that opens another spreadsheet (spreadsheet B).
This second spreadsheet is named: "Projections 2006".

I create a var called WB2 which contains the name of this spreadsheet:
WB2 = ActiveWorkbook.Name

The macro then does some sorting and formatting on this spreadsheet.
I now want to add a formula in Spreadsheet A that points to a specific
cell
in spreadsheet B (wb2)
I've tried several variations of the formula below and nothing works.

ActiveCell.FormulaR1C1 = "='[wb2]projections'!R3C5"

Can someone point me in the right direction?

Thanks,
El Bee




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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Runing a macro in a workbook from another macro in other workbook dhatul Excel Discussion (Misc queries) 0 January 13th 06 06:27 AM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 05:46 AM.

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

About Us

"It's about Microsoft Excel"