way to add formula to numbers

XHelp123

New Member
Joined
Sep 23, 2018
Messages
2
I have a bunch of columns containing numbers. I want to add a 1 or a 0 in the first cell in each column to turn the numbers on or off.

The sheet i have is pretty big - it will take hours to edit the value in each cell to add an = at the start of each number and a * the first cell in the column at the end of each number.

There must be an easy way to do this?

Thanks for any help!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hello,

Do you need to add or to multiply ...??? :wink:
 
Upvote 0
OK ...

Where are your On/Off factors ...( 1 and 0 ) ...???

Let's assume all your numbers are Column A and your factors in Column B ...

You can test following:

Code:
Sub Adjust()
Dim c As Range
Dim rng As Range
' adjust A100 to your situation
Set rng = ActiveSheet.Range("A1:A100")
  For Each c In rng
    c.Formula = "=" & c & "*" & c.Offset(0, 1).Address(0, 0)
  Next c
End Sub

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,215,479
Messages
6,125,041
Members
449,206
Latest member
Healthydogs

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