Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default change several cells based upon the value of one cell

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default change several cells based upon the value of one cell

This was asked and answered in a previous post.

Private Sub Worksheet_change(ByVal Target As Range)
If Target.Address = Cells(5, 2).Address Then
With Range("saltboxroofing").Font
..Color = vbBlack
If UCase(Target) = "GABLE" Then .Color = vbWhite
End With
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"punking315" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default change several cells based upon the value of one cell

thanks for the nonsense

"Don Guillett" wrote:

This was asked and answered in a previous post.

Private Sub Worksheet_change(ByVal Target As Range)
If Target.Address = Cells(5, 2).Address Then
With Range("saltboxroofing").Font
..Color = vbBlack
If UCase(Target) = "GABLE" Then .Color = vbWhite
End With
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"punking315" wrote in message
...
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change drop down list in one cell based on values in other cells Hemi Excel Discussion (Misc queries) 3 April 5th 23 02:48 PM
In excel change color of a range of cells based on a cell value kwitt Excel Worksheet Functions 1 November 18th 09 07:20 PM
Change cell background based on multiple cells [email protected] Excel Worksheet Functions 2 July 25th 07 05:03 PM
Is it possible to change colors of cells based on value in cell (. LC Excel Worksheet Functions 3 January 14th 05 05:27 AM
Change the colour of a bunch of cells, based on one cell. Craig & Co. Excel Programming 2 October 14th 04 06:28 AM


All times are GMT +1. The time now is 03:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"