Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default formula after running a macro

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.
  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default formula after running a macro

without seeing your code my guess is you are populating the cells with the
values rather than the formuals eg....

MySum = application.worksheetfunction.sum("A1:A10")
Range("a11") = MySum

it should be

range("a11") = "=Sum("""A1:A10""")"

this will populate a formula into the cell and not just a value



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.

  #3   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default formula after running a macro

sorry for the quotes the formula should be

range("a11") = "=Sum(A1:A10)"



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

without seeing your code my guess is you are populating the cells with the
values rather than the formuals eg....

MySum = application.worksheetfunction.sum("A1:A10")
Range("a11") = MySum

it should be

range("a11") = "=Sum("""A1:A10""")"

this will populate a formula into the cell and not just a value



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default formula after running a macro

Thanks for the reply

in fact this is what i am doing:
inside a loop:

clicks = clicks + Range("f" & CStr(i))
and after exiting the loop:
Range("f" & CStr(row + 1)) = clicks

"ben" wrote:

sorry for the quotes the formula should be

range("a11") = "=Sum(A1:A10)"



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

without seeing your code my guess is you are populating the cells with the
values rather than the formuals eg....

MySum = application.worksheetfunction.sum("A1:A10")
Range("a11") = MySum

it should be

range("a11") = "=Sum("""A1:A10""")"

this will populate a formula into the cell and not just a value



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.

  #5   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default formula after running a macro

hmmm

range("f" & row+1) = "=Sum(F" & LowestRow & ":f" & HighestRow & ")"
use lowest/highest row to determine start and stop point and use above line
outside of code

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

Thanks for the reply

in fact this is what i am doing:
inside a loop:

clicks = clicks + Range("f" & CStr(i))
and after exiting the loop:
Range("f" & CStr(row + 1)) = clicks

"ben" wrote:

sorry for the quotes the formula should be

range("a11") = "=Sum(A1:A10)"



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

without seeing your code my guess is you are populating the cells with the
values rather than the formuals eg....

MySum = application.worksheetfunction.sum("A1:A10")
Range("a11") = MySum

it should be

range("a11") = "=Sum("""A1:A10""")"

this will populate a formula into the cell and not just a value



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default formula after running a macro

thank you

"ben" wrote:

hmmm

range("f" & row+1) = "=Sum(F" & LowestRow & ":f" & HighestRow & ")"
use lowest/highest row to determine start and stop point and use above line
outside of code

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

Thanks for the reply

in fact this is what i am doing:
inside a loop:

clicks = clicks + Range("f" & CStr(i))
and after exiting the loop:
Range("f" & CStr(row + 1)) = clicks

"ben" wrote:

sorry for the quotes the formula should be

range("a11") = "=Sum(A1:A10)"



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

without seeing your code my guess is you are populating the cells with the
values rather than the formuals eg....

MySum = application.worksheetfunction.sum("A1:A10")
Range("a11") = MySum

it should be

range("a11") = "=Sum("""A1:A10""")"

this will populate a formula into the cell and not just a value



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"SHIRA" wrote:

I have built a macro that is reading raw data and create a report from the
data,the report is great but the formula aren't shown in the end report.

for example:

if in my macro i have made a sum of different fields the result in the
report is a number without the formula.

there is a way to see the embedded formula after running the macro.

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
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Running a macro from a conditional formula Jim Excel Discussion (Misc queries) 1 July 27th 06 01:34 AM
Stop running a macro in the middle of a macro gmunro Excel Programming 3 June 9th 05 06:00 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


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