PC Review


Reply
Thread Tools Rate Thread

Changing a formula to value only

 
 
gcouch
Guest
Posts: n/a
 
      11th Jan 2008
I have a spreadsheet that shows stockholding figures on a day to day basis. I
have a row with a date in each column for each day of the week, and in the
respective columns beneath each date i have formulae which look to a
different spreadsheet (with a date stamp), to update the information in a
number of cells in the column which the date matches. At the moment i have to
manually highlight the updated cells and convert the formulae to values, so
they don't reset to zero the following day because the date doesn't match.
Is there a way to run a macro, which will look at a range of cells in one
row, and if it comes across a cell in that range which has a figure greater
than zero, will select a set number of cells above this figure to convert the
formulae to values ?
Any help would be appreciated
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      11th Jan 2008
If Range("A1").HasFormula = True and Range("A1").Value > 0 Then
Range("A1").Value = Range("A1").Value
End If

"gcouch" wrote:

> I have a spreadsheet that shows stockholding figures on a day to day basis. I
> have a row with a date in each column for each day of the week, and in the
> respective columns beneath each date i have formulae which look to a
> different spreadsheet (with a date stamp), to update the information in a
> number of cells in the column which the date matches. At the moment i have to
> manually highlight the updated cells and convert the formulae to values, so
> they don't reset to zero the following day because the date doesn't match.
> Is there a way to run a macro, which will look at a range of cells in one
> row, and if it comes across a cell in that range which has a figure greater
> than zero, will select a set number of cells above this figure to convert the
> formulae to values ?
> Any help would be appreciated

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      11th Jan 2008
This would check a range of cells and set values.
Change the sheet and range reference to your requirement.

Sub valequval()
Dim c As Range
Set myRng = Worksheets(1).Range("A150") 'Adjust to actual
For Each c In myRng
If c.HasFormula = True And c.Value > 0 Then
c.Value = c.Value
End If
Next
End Sub

"gcouch" wrote:

> I have a spreadsheet that shows stockholding figures on a day to day basis. I
> have a row with a date in each column for each day of the week, and in the
> respective columns beneath each date i have formulae which look to a
> different spreadsheet (with a date stamp), to update the information in a
> number of cells in the column which the date matches. At the moment i have to
> manually highlight the updated cells and convert the formulae to values, so
> they don't reset to zero the following day because the date doesn't match.
> Is there a way to run a macro, which will look at a range of cells in one
> row, and if it comes across a cell in that range which has a figure greater
> than zero, will select a set number of cells above this figure to convert the
> formulae to values ?
> Any help would be appreciated

 
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
Changing the range for averages with out changing the formula. JessLRC Microsoft Excel Worksheet Functions 0 20th Apr 2010 03:10 PM
how to edit formula without changing formula of each cell =?Utf-8?B?c2FkYXQ=?= Microsoft Excel Worksheet Functions 2 24th Apr 2007 02:02 PM
Changing formula to a value newbie101 Microsoft Excel Worksheet Functions 1 16th Aug 2006 02:19 PM
Need Help changing FORMULA zipper21 Microsoft Excel Misc 2 2nd Apr 2006 09:44 AM
Copy Formula Down Without Changing Entire Formula =?Utf-8?B?cm95Lm9raW5hd2E=?= Microsoft Excel Misc 3 16th Mar 2006 01:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:34 PM.