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

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Changing a formula to value only

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Changing a formula to value only

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("A1:D50") '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
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
Changing the range for averages with out changing the formula. JessLRC Excel Worksheet Functions 0 April 20th 10 03:10 PM
changing formula S S Excel Worksheet Functions 6 August 30th 07 04:00 PM
how to edit formula without changing formula of each cell sadat Excel Worksheet Functions 2 April 24th 07 02:02 PM
Changing a Formula Skip Excel Worksheet Functions 1 August 13th 06 11:49 PM
Copy Formula Down Without Changing Entire Formula roy.okinawa Excel Discussion (Misc queries) 3 March 16th 06 01:54 AM


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