PC Review


Reply
Thread Tools Rate Thread

change values to formulas

 
 
=?Utf-8?B?bWF0dG1hYw==?=
Guest
Posts: n/a
 
      3rd Apr 2007
I've seen a lot of threads addressing changing formulas to values, but
haven't come across one going the other way. I have a spreadsheet that gets
created with all values. Column E is the sum of columns C and D. I'm trying
to figure out the code that will go through column E, and at every occurance
of a number, replace that number with the formula =C+D.

I tried using Isnumeric as a test, but it plugged that formula into all the
blank cells as well.
If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"

Suggestions?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      3rd Apr 2007
I should have said

if not activecell.value like "*=*" then


"mattmac" wrote:

> I've seen a lot of threads addressing changing formulas to values, but
> haven't come across one going the other way. I have a spreadsheet that gets
> created with all values. Column E is the sum of columns C and D. I'm trying
> to figure out the code that will go through column E, and at every occurance
> of a number, replace that number with the formula =C+D.
>
> I tried using Isnumeric as a test, but it plugged that formula into all the
> blank cells as well.
> If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
>
> Suggestions?

 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      3rd Apr 2007
Try looking for the "=" sign.

if activecell.value like "*=*" then ...

"mattmac" wrote:

> I've seen a lot of threads addressing changing formulas to values, but
> haven't come across one going the other way. I have a spreadsheet that gets
> created with all values. Column E is the sum of columns C and D. I'm trying
> to figure out the code that will go through column E, and at every occurance
> of a number, replace that number with the formula =C+D.
>
> I tried using Isnumeric as a test, but it plugged that formula into all the
> blank cells as well.
> If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
>
> Suggestions?

 
Reply With Quote
 
=?Utf-8?B?bWF0dG1hYw==?=
Guest
Posts: n/a
 
      3rd Apr 2007
I'm sorry if I wasn't clear: The cells just have numbers in them, no
formulas. I want to change the value to a formula.

"Barb Reinhardt" wrote:

> Try looking for the "=" sign.
>
> if activecell.value like "*=*" then ...
>
> "mattmac" wrote:
>
> > I've seen a lot of threads addressing changing formulas to values, but
> > haven't come across one going the other way. I have a spreadsheet that gets
> > created with all values. Column E is the sum of columns C and D. I'm trying
> > to figure out the code that will go through column E, and at every occurance
> > of a number, replace that number with the formula =C+D.
> >
> > I tried using Isnumeric as a test, but it plugged that formula into all the
> > blank cells as well.
> > If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
> >
> > Suggestions?

 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      3rd Apr 2007
Try this

if not activecell.value like "*=*"

this will find the active cells that don't have a formula.


"mattmac" wrote:

> I'm sorry if I wasn't clear: The cells just have numbers in them, no
> formulas. I want to change the value to a formula.
>
> "Barb Reinhardt" wrote:
>
> > Try looking for the "=" sign.
> >
> > if activecell.value like "*=*" then ...
> >
> > "mattmac" wrote:
> >
> > > I've seen a lot of threads addressing changing formulas to values, but
> > > haven't come across one going the other way. I have a spreadsheet that gets
> > > created with all values. Column E is the sum of columns C and D. I'm trying
> > > to figure out the code that will go through column E, and at every occurance
> > > of a number, replace that number with the formula =C+D.
> > >
> > > I tried using Isnumeric as a test, but it plugged that formula into all the
> > > blank cells as well.
> > > If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
> > >
> > > Suggestions?

 
Reply With Quote
 
=?Utf-8?B?QnJ1Y2UgQm9saW8=?=
Guest
Posts: n/a
 
      3rd Apr 2007
How about?

If IsNumeric(ActiveCell.Value) and isempty(activecell.value) = False Then

--
Thanks,

Bruce Bolio


"mattmac" wrote:

> I've seen a lot of threads addressing changing formulas to values, but
> haven't come across one going the other way. I have a spreadsheet that gets
> created with all values. Column E is the sum of columns C and D. I'm trying
> to figure out the code that will go through column E, and at every occurance
> of a number, replace that number with the formula =C+D.
>
> I tried using Isnumeric as a test, but it plugged that formula into all the
> blank cells as well.
> If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
>
> Suggestions?

 
Reply With Quote
 
=?Utf-8?B?bWF0dG1hYw==?=
Guest
Posts: n/a
 
      3rd Apr 2007
Adding the "isempty" code works perfectly! Thanks!!!

I've tried the "if not activecell.value like "*=*" then" code and was still
getting the same error where all blank cells were getting populated with
formulas.

"Bruce Bolio" wrote:

> How about?
>
> If IsNumeric(ActiveCell.Value) and isempty(activecell.value) = False Then
>
> --
> Thanks,
>
> Bruce Bolio
>
>
> "mattmac" wrote:
>
> > I've seen a lot of threads addressing changing formulas to values, but
> > haven't come across one going the other way. I have a spreadsheet that gets
> > created with all values. Column E is the sum of columns C and D. I'm trying
> > to figure out the code that will go through column E, and at every occurance
> > of a number, replace that number with the formula =C+D.
> >
> > I tried using Isnumeric as a test, but it plugged that formula into all the
> > blank cells as well.
> > If IsNumeric(ActiveCell.Value) Then ActiveCell.FormulaR1C1 = "=RC[-2]+RC[-1]"
> >
> > Suggestions?

 
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
CELLS NOT CALC FORMULAS - VALUES STAY SME FORMULAS CORRECT?? HELP =?Utf-8?B?U2hlcmJlcmc=?= Microsoft Excel Worksheet Functions 4 11th Sep 2007 01:34 AM
Change formulas into values based on cell color Aria Microsoft Excel Programming 2 23rd Oct 2006 10:55 PM
Formulas not recalculating when values change on another sheet =?Utf-8?B?QmlsbA==?= Microsoft Excel Worksheet Functions 0 15th Sep 2005 10:29 PM
AdvancedFilter on cells with formulas, returning values and not formulas Claus Microsoft Excel Programming 2 7th Sep 2005 02:40 PM
is there a way to change formulas to values for sorting purposes? =?Utf-8?B?Q2hhbmdlIGZvcm11bGFzIHRvIHZhbHVlcw==?= Microsoft Excel Worksheet Functions 3 2nd Sep 2005 05:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 AM.