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

I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?

Can I include Excel Formula such as (=A1+A6) in a Macro?

Frank.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Cell Content

On Jan 16, 4:50*pm, wrote:
I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. *Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?

Can I include Excel Formula such as (=A1+A6) in a Macro?

Frank.

hello,
you can modify the value of a cell in a macro by writing a command
similar to:
Range("A1").Value = 123
and you can enter a formula by writing a command similar to:
Range("B1").Formula = "=sum(A1:A6)"
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Cell Content

On Jan 16, 7:05*pm, GTVT06 wrote:
On Jan 16, 4:50*pm, wrote: I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. *Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?


Can I include Excel Formula such as (=A1+A6) in a Macro?


Frank.


hello,
you can modify the value of a cell in a macro by writing a command
similar to:
Range("A1").Value = 123
and you can enter a formula by writing a command similar to:
Range("B1").Formula = "=sum(A1:A6)"


Thanks for your help. I will give it a try.

Frank
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Cell Content

On Jan 16, 7:05*pm, GTVT06 wrote:
On Jan 16, 4:50*pm, wrote: I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. *Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?


Can I include Excel Formula such as (=A1+A6) in a Macro?


Frank.


hello,
you can modify the value of a cell in a macro by writing a command
similar to:
Range("A1").Value = 123
and you can enter a formula by writing a command similar to:
Range("B1").Formula = "=sum(A1:A6)"


I tried the command and it works well. Howver, I also would like to
introduce a variable into the equation as follows:
Range("B1").Formula = "=sum(A1:A6)" + Variable

Is this possible?

Frank
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Cell Content

On Jan 16, 7:50*pm, wrote:
On Jan 16, 7:05*pm, GTVT06 wrote:

On Jan 16, 4:50*pm, wrote: I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. *Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?


Can I include Excel Formula such as (=A1+A6) in a Macro?


Frank.


hello,
you can modify the value of a cell in a macro by writing a command
similar to:
Range("A1").Value = 123
and you can enter a formula by writing a command similar to:
Range("B1").Formula = "=sum(A1:A6)"


I tried the command and it works well. Howver, I also would like to
introduce a variable into the equation as follows:
Range("B1").Formula = "=sum(A1:A6)" + Variable

Is this possible?

Frank

somthing like this?

Dim i As Variant
i = InputBox("Additional number to add?")
Range("B1").Formula = "=sum(A1:A6," & i & ")"


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Cell Content

On Jan 16, 9:29*pm, GTVT06 wrote:
On Jan 16, 7:50*pm, wrote:



On Jan 16, 7:05*pm, GTVT06 wrote:


On Jan 16, 4:50*pm, wrote: I am trying to use a Macro to sort through a table of numeric values
and modify the values based on a series of If statements. *Can someone
tell me if the contents of a cell can be modified with a Macro, other
than simple Copy/Cut/Paste funstion?


Can I include Excel Formula such as (=A1+A6) in a Macro?


Frank.


hello,
you can modify the value of a cell in a macro by writing a command
similar to:
Range("A1").Value = 123
and you can enter a formula by writing a command similar to:
Range("B1").Formula = "=sum(A1:A6)"


I tried the command and it works well. Howver, I also would like to
introduce a variable into the equation as follows:
Range("B1").Formula = "=sum(A1:A6)" + Variable


Is this possible?


Frank


somthing like this?

Dim i As Variant
i = InputBox("Additional number to add?")
Range("B1").Formula = "=sum(A1:A6," & i & ")"- Hide quoted text -

- Show quoted text -


I just tried your suggestion and it does what I was looking for.

Thanks,
Frank
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
When content of a cell changes, content of another deletes [email protected] Excel Programming 4 October 26th 07 08:17 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
Conditional cell background formatting, based on cell content nosivad Excel Discussion (Misc queries) 5 February 11th 06 11:12 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 01:06 PM.

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"