Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Referencing a cell, not the value



I have the following line in some VBA:

objSht.Cells(Row, "U").Formula = "=477" & "* Q" & Row & ""

This line basically sets the formula for all of column U for as many
rows as there are. It works great.

However, suppose if I had a worksheet called "Data" and in that
worksheet I had a cell lets say B1 and in that cell is the 477 figure.


How can I make this dynamic? Meaning, if the user changes the 477 to
577, I want all of the formulas referencing that cell to update
properly?


Thanks,
Brian

  #2   Report Post  
Posted to microsoft.public.excel.programming
jjk jjk is offline
external usenet poster
 
Posts: 42
Default Referencing a cell, not the value

Try this.

objSht.Cells(Row, "U").Formula = "=Data!$B$1" & "* Q" & Row & ""

Regards,
Jayant

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Referencing a cell, not the value

I'm hoping you've just been looking at it too long

objSht.Cells(Row, "U").Formula = "=" & objsht.Range("B5").value & " & "*
Q" & Row & ""


"BerkshireGuy" wrote:



I have the following line in some VBA:

objSht.Cells(Row, "U").Formula = "=477" & "* Q" & Row & ""

This line basically sets the formula for all of column U for as many
rows as there are. It works great.

However, suppose if I had a worksheet called "Data" and in that
worksheet I had a cell lets say B1 and in that cell is the 477 figure.


How can I make this dynamic? Meaning, if the user changes the 477 to
577, I want all of the formulas referencing that cell to update
properly?


Thanks,
Brian


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Referencing a cell, not the value

Awesome!

This newbie thanks you!

-Brian

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
Help with cell referencing. excel novice2 New Users to Excel 0 January 14th 12 11:35 PM
Help with cell referencing. excel novice2 New Users to Excel 0 January 14th 12 11:35 PM
Referencing Last Cell jlo Excel Worksheet Functions 8 September 4th 08 09:06 PM
Referencing Cell Next To Today's Date Cell Docktondad Excel Discussion (Misc queries) 5 May 16th 07 10:25 PM
cell referencing JKSommers Excel Worksheet Functions 2 February 18th 07 10:57 PM


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