LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Relative Formula References NOT changing After Insert From VB

I'm creating an Excel Workbook from VB and inserting some formulas (from VB
into Excel).

The formulas are column specific and are
relative reference formulas. For example

oWB.ActiveSheet.Cells(row, "H").Formula = "=IF(B7=""B"", ((F7-D7) * C7 *
50), ((F7-D7) * C7 * 50))" 'Gross Profit
..
After insertion Excel shows a value for the formula, but the value is for
the first row inserted. All subsequent rows contain the same formula and
EXCEL does NOT adjust the relative Cell Formula References so the correct
value is calculated for that row.

QUESTIONS

1) What am I doing wrong?

===================

What's the best way to handle Formulas when creating a new Workbook from VB:

1) Same as above using Formula Property

2) Putting Formula into an Existing Excel Workbook/Sheet and copying the
formula from one Excel Workbook to another

3) Create a separate sheet, Insert formulas into that sheet and then copy
to sheet of interest.

4) Other

Thanks


 
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
Changing relative references jbearcat Excel Discussion (Misc queries) 1 June 28th 09 04:10 PM
How to copy an array without changing relative cell references? Dmitry Excel Worksheet Functions 10 June 20th 06 01:11 PM
How to copy an array without changing relative cell references? Dmitry Excel Programming 9 June 20th 06 01:11 PM
How to copy an array without changing relative cell references? Dmitry Excel Worksheet Functions 0 June 19th 06 03:08 PM
How to copy an array without changing relative cell references? Dmitry Excel Programming 0 June 19th 06 03:08 PM


All times are GMT +1. The time now is 11:36 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"