Complete several cells based on single-cell entry

LabRat8454

New Member
Joined
Nov 20, 2013
Messages
2
I am really new to VBA and I am trying to set up a spreadsheet for lab observations but I'm stuck. I have a series of drop-down menus incorporated into the sheet but I need something so that if "Normal" is selected in column C, then the rest of the cells in that row from columns D to G (range may change once remaining options have been entered) will be populated with "0 - Normal". It seems like it should be simple, but I don't have the experience that would enable me to write a macro(?) for this. I would appreciate any and all help :)
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the Mr. Excel Message Board!

First this is a Change Event, and needs to be put in the Worksheet Code:

Worksheet_Code.gif


Paste the following Code:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)


On Error GoTo ErrorHandler:
If Intersect(Target, Range("C:C")) Is Nothing Then Exit Sub


If Target.Value = "Normal" Then
    Target.Offset(0, 1).Value = " 0 - Normal"
    Target.Offset(0, 2).Value = " 0 - Normal"
    Target.Offset(0, 3).Value = " 0 - Normal"
    Target.Offset(0, 4).Value = " 0 - Normal"
' Put Code here


End If
ErrorHandler:
End Sub

Essentially this looks for changes in Column C, if it finds a change in Column C, if the values that it is changed to equals "Normal" then the it will change the Columns D - G, or Offset 1 thru 4 (from C) to "0 - Normal"

Hope that helps, if you run into issues, please let me know and as always be sure to back up your excel workbook before running this macro!
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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