Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
changing several cells (both cotent & format) base on value of 1 c
using vba.... what's the best way to change several cells based upon the
value of one cell. I know to a seasoned programmer the following attempt is laughable but bear with me, here is the code I'm wrestling with: Public Sub worksheet_calculate(ByVal Target As Range) If Range("select_type").Text = "gable" Then Range("gableroofing_value").Value = Val(Range("L83")) Else If Range("select_type").Text = "saltbox" Then Range("gableroofing_value").Value = "" End If End If End Sub Private Sub worksheet_calculate() If Range("select_type").Text = "gable" Then Range("saltboxroofing_value").Value = "" Else If Range("select_type").Text = "saltbox" Then Range("saltboxroofing_value").Value = (Val(Cells(85, 12)) + Val(Cells(86, 12))) Else End If End If End Sub Private Sub Worksheet_Change(ByVal Target As Range) If Range("select_type").Text = "gable" Then Range("saltboxroofing").Font.Color = RGB(255, 255, 255) Else If Range("select_type").Text = "saltbox" Then Range("saltboxroofing").Font.Color = RGB(0, 0, 0) Else End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing format of cells | Excel Programming | |||
Changing format of cells | Excel Programming | |||
Changing Cell Reference in a macro on global base | Excel Discussion (Misc queries) | |||
Changing Cells format using VBA | Excel Programming | |||
VBA / VB Numeric base changing function | Excel Programming |