Related:
- Conditional formatting using macros
- Macros in excel download free - Download - Spreadsheets
- Clear formatting in excel - Guide
- Phone formatting software for pc - Download - File management
- Excel online macros - Guide
- Formatting usb mac - Guide
4 responses
sorry i didnt mention earlier, the drop down list contains more than 3 values which i believe conditional formatting will not take care of.
Ivan-hoe
Posts
433
Registration date
Saturday February 16, 2008
Status
Member
Last seen
October 17, 2008
110
Jul 22, 2008 at 07:47 AM
Jul 22, 2008 at 07:47 AM
Hello,
No need to use macros to do what you want to do. You can simply use Excel conditionnal formatting, with the formulas below :
for columns B and C : =OR($A2="A";$A2="B")
for column D : =$A2="B"
Nevertheless if you want to use a macro, you can use the event Worksheet_Change to have your macro run automatically
Ivan
No need to use macros to do what you want to do. You can simply use Excel conditionnal formatting, with the formulas below :
for columns B and C : =OR($A2="A";$A2="B")
for column D : =$A2="B"
Nevertheless if you want to use a macro, you can use the event Worksheet_Change to have your macro run automatically
Private Sub Worksheet_Change(ByVal Target As Range) Dim MyRange As Range, MyColor If Intersect(Range("A1:A100"), Target) Is Nothing Then Exit Sub With Target .Range("B1:D1").Interior.Color = xlNone Select Case .Value Case Is = "A" Set MyRange = .Range("B1:C1") MyColor = 65535 Case Is = "B" Set MyRange = .Range("B1:D1") MyColor = 65535 Case Else Set MyRange = .Range("B1:D1") MyColor = xlNone End Select MyRange.Interior.Color = MyColor End With End Sub
Ivan
Hi Ivan,
I used this program to solve mz problem:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range, MyColor
If Intersect(Range("A1:A100"), Target) Is Nothing Then Exit Sub
With Target
.Range("B1:D1").Interior.Color = xlNone
Select Case .Value
Case Is = "A"
Set MyRange = .Range("B1:C1")
MyColor = 65535
Case Is = "B"
Set MyRange = .Range("B1:D1")
MyColor = 65535
Case Else
Set MyRange = .Range("B1:D1")
MyColor = xlNone
End Select
MyRange.Interior.Color = MyColor
End With
End Sub
can you please modify this program , I want use some Text value in stead coloring the column.
For eg: i want
Case Is = "A"
Set MyRange = .Range("B1:C1")
MyColor = 65535 instead color i want MyColor=abc value in column ........like this
regards,
sats
I used this program to solve mz problem:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range, MyColor
If Intersect(Range("A1:A100"), Target) Is Nothing Then Exit Sub
With Target
.Range("B1:D1").Interior.Color = xlNone
Select Case .Value
Case Is = "A"
Set MyRange = .Range("B1:C1")
MyColor = 65535
Case Is = "B"
Set MyRange = .Range("B1:D1")
MyColor = 65535
Case Else
Set MyRange = .Range("B1:D1")
MyColor = xlNone
End Select
MyRange.Interior.Color = MyColor
End With
End Sub
can you please modify this program , I want use some Text value in stead coloring the column.
For eg: i want
Case Is = "A"
Set MyRange = .Range("B1:C1")
MyColor = 65535 instead color i want MyColor=abc value in column ........like this
regards,
sats
Ivan-hoe
Posts
433
Registration date
Saturday February 16, 2008
Status
Member
Last seen
October 17, 2008
110
Sep 8, 2008 at 02:55 AM
Sep 8, 2008 at 02:55 AM
Hello Sats,
to insert some text in a cell, use its property Value
e.g. :
Ivan
to insert some text in a cell, use its property Value
e.g. :
Case Is = "A" .range("B1").Value = "abc" Case Is = "B" .range("B1").Value = "pqr" .range("C1").Value = "xyz"
Ivan