multiple operations and formulas in spread sheet

i8ig

Board Regular
Joined
Jul 17, 2007
Messages
122
I need to create a spread sheet that in Col A has 3 variables, each of which I need to triger 1)fill of that row, 2)different formula's in different columns within that row. Is this possible in excel?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Need more details!!
Be very clear on what you are wanting and give us examples of data and results if possible.

Michael
 
Upvote 0
Yes it probably is possible but you will have to be more specific about what you want.
 
Upvote 0
Sorry, Col A will have 3 'Names' each of these names needs to be able to trigger the filling of the entire row with a color. The same trigger needs to place formula's in (one formula in different columns for 2 of the 'Names' and 1 formula in 4 different cells on the other 'Name')

Example:

Name
A: Adds yellow to entire row and places formula in cell K of this row
B: Adds lt blue to entire row and places formula in cell M of this row
C: Leaves row without fill and places formulas in cells D, H,M and Q

No sumation of any of the values or cells
Hope this helps
 
Upvote 0
Try this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    If Target.Value = "A" Then
        Rows(Target.Row).Interior.ColorIndex = 6
        Cells(Target.Row, 11) = "formula here"
        Else
            If Target.Value = "B" Then
                Rows(Target.Row).Interior.ColorIndex = 41
                Cells(Target.Row, 13) = "formula here"
                Else
                    If Target.Value = "C" Then
                        Rows(Target.Row).Interior.ColorIndex = xlColorIndexNone
                        Cells(Target.Row, 4) = "D formula here"
                        Cells(Target.Row, 8) = "H formula here"
                        Cells(Target.Row, 13) = "M formula here"
                        Cells(Target.Row, 17) = "Q formula here"
                        Else
                            Rows(Target.Row).Interior.ColorIndex = xlColorIndexNone
                    End If
            End If
    End If
End If
End Sub
 
Upvote 0
Thanks, I am new to excel and don't understand where this is supposed to be placed in the spreadsheet. Could you assist?
 
Upvote 0
Right click on the worksheet tab and select View Code, the VB Editor will open. Paste the code into this window. Then close the VB Editor. That should be all you have to do.
 
Upvote 0
A couple of additional questions: 1) If I need to change the formula in "A" to another cell, where would I do this in the CODE?
2) If I need to modify the formula in "B" where would I do this in the CODE?
3) No color is added to the rows, how do I add this?
 
Upvote 0
Still need assistance with macro, will not put color on rows and I need to understand how to move formulas to different cells and change formulas :biggrin:
 
Upvote 0
Not quite sure what you mean. The macro should colour the rows as you specified originally.

When you say you want to move formulas to different cells, so you mean you want to change where the formulas are being output on the worksheet?
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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