Turning raw data into formulas

CMoody

New Member
Joined
May 8, 2009
Messages
3
We rececently added an SAP expense forecasting tool, which runs using Excel. While the tool is still being developed to forecast, I am using SAP & hard-keying in data to create a actuals+forecast view. Trouble is, when I "refresh" the SAP app. all of the data I hard-keyed in changes (this is desireable on a monthly basis, but I want to preserve future months forecast). In order to preserve the future month's data, I need to make all of the hard-keyed #'s equal formulas...(SAP will leave those #'s alone).

Is there a shortcut to take a data set and transform it to have a equal sign in front of it, without manually inserting it?:confused:

Your help will save me hours of inserting equal signs before my forecast that I want to preserve! Thanks!
 
Hello and welcome to MrExcel.

Try selecting the range and running this macro:

Code:
Sub test()
Dim c As Range
For Each c In Selection
    If Not c.HasFormula Then c.Formula = "=" & c.Value
Next c
End Sub
 
Upvote 0
Perhaps something like this. Select your range and run the subroutine

Code:
Sub AddEqual()
Dim c As Range

For Each c In Selection
    If IsNumeric(c.Value) And Not IsEmpty(c.Value) Then c.Formula = "=" & c.Value
Next
End Sub
 
Upvote 0
Thanks for the quick response. Unfortunately, I do not know how to run a macro. I am looking through Excel Help and following the "how to run a macro" directions. Is there a quick way to do this?
 
Upvote 0
From Excel do Alt + F11. Find your workbook on the left-hand side, highlight it, then right click > insert module. In the module paste the code. Go to your worksheet and select your range, go back to the module, click inside the subroutine, and hit F5.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top