If statement question

BX

Board Regular
Joined
Jun 2, 2002
Messages
172
Hi
I would like to create an if statement, so if the criteria is true, then 5 other cells value changes to a selected value. The trouble I'm having is that I've only constructed if statements so the cell where the statement is in changes. How do I set up an if statement so if the statement is true/false another cell separate from the cell with the statement changes.
Thanks
BX
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
The easiest way to do it is with a macro. It would look something like this:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Range("A1") = 1 Then
Range("B1:B5") = "Five times the lovin'"
End If
End Sub

So anytime data is entered onto the worksheet the macro is run. If the value in cell A1 is 1, then cells B1:B5 have "Five times the lovin'" in them.

Otherwise, you would have to use a cell reference in your cells. For example:

Cells B1:B5 would have the following

=if($A$1=1,"Five times the lovin'","")

Does this help?
 
Upvote 0
Thanks,
Unfortunately I'm still not that advanced in macros. Is there possibly an easier way?
 
Upvote 0
The bottom portion of my last post was a means of doing it within Excel. If you want to give me an example of what cells you want to to what in, I will offer you the formulas.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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