PC Review


Reply
Thread Tools Rate Thread

Cell Content

 
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      16th Jan 2008
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.
 
Reply With Quote
 
 
 
 
GTVT06
Guest
Posts: n/a
 
      17th Jan 2008
On Jan 16, 4:50*pm, wfgfree...@gmail.com 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)"
 
Reply With Quote
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      17th Jan 2008
On Jan 16, 7:05*pm, GTVT06 <gtv...@hotmail.com> wrote:
> On Jan 16, 4:50*pm, wfgfree...@gmail.com 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
 
Reply With Quote
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      17th Jan 2008
On Jan 16, 7:05*pm, GTVT06 <gtv...@hotmail.com> wrote:
> On Jan 16, 4:50*pm, wfgfree...@gmail.com 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
 
Reply With Quote
 
GTVT06
Guest
Posts: n/a
 
      17th Jan 2008
On Jan 16, 7:50*pm, wfgfree...@gmail.com wrote:
> On Jan 16, 7:05*pm, GTVT06 <gtv...@hotmail.com> wrote:
>
> > On Jan 16, 4:50*pm, wfgfree...@gmail.com 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 & ")"
 
Reply With Quote
 
wfgfreedom@gmail.com
Guest
Posts: n/a
 
      17th Jan 2008
On Jan 16, 9:29*pm, GTVT06 <gtv...@hotmail.com> wrote:
> On Jan 16, 7:50*pm, wfgfree...@gmail.com wrote:
>
>
>
> > On Jan 16, 7:05*pm, GTVT06 <gtv...@hotmail.com> wrote:

>
> > > On Jan 16, 4:50*pm, wfgfree...@gmail.com 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combining content from an input box with existing cell content Colin Hayes Microsoft Excel Worksheet Functions 2 25th Jul 2010 02:30 PM
When content of a cell changes, content of another deletes mrlanier@hotmail.com Microsoft Excel Programming 4 26th Oct 2007 08:17 PM
Cell Formula reference to cell Based On third Cell Content =?Utf-8?B?R2FicmllbA==?= Microsoft Excel Misc 1 11th Feb 2005 06:36 AM
Cell Formula reference to cell Based On third Cell Content =?Utf-8?B?R2FicmllbA==?= Microsoft Excel Misc 0 11th Feb 2005 05:35 AM
Highlighting cell content based on content of another cell bkarlstrom Microsoft Excel Worksheet Functions 3 4th Dec 2003 02:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:07 PM.