|
-
Jul 12th, 2010, 10:52 AM
#1
Thread Starter
Addicted Member
[RESOLVED] color change the entire rows
I am trying to do from outlook to excel if the cell value is empty change the entire row will be yellow but i have error Cells(c.Row, 7).Value = ""
Code:
With Sheets("Sheet1").Range("C6:C29")
Set c = .Find(MYName, LookIn:=xlValues)
If Not c Is Nothing Then
MyTime = olMail.ReceivedTime
Cells(c.Row, 7).Value = MyTime
Else
Cells(c.Row, 7).Value = ""
Range(Cells(c.Row, 1), Cells(c.Row, 7)).Interior.ColorIndex = 35
End If
End With
Last edited by Hack; Jul 12th, 2010 at 10:54 AM.
Reason: Fixed Code Tags
-
Jul 12th, 2010, 10:54 AM
#2
Re: color change the entire rows
-
Jul 12th, 2010, 11:00 AM
#3
Re: color change the entire rows
You will get an error if there is no text found because you will not get a value for c.Row in the "Else" part.
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jul 12th, 2010, 11:05 AM
#4
Thread Starter
Addicted Member
Re: color change the entire rows
could you help me Kool
so how do i put it in the code if the cell value is empty the entrie row will be changed the yellow color
-
Jul 12th, 2010, 02:01 PM
#5
Re: color change the entire rows
 Originally Posted by kamakshi
could you help me Kool
so how do i put it in the code if the cell value is empty the entrie row will be changed the yellow color
Sure
Is this what you are trying?
Code:
With Sheets("Sheet1").Range("C6:C29")
Set c = .Find(MYName, LookIn:=xlValues)
If Not c Is Nothing Then
MyTime = olMail.ReceivedTime
Cells(c.Row, 7).Value = MyTime
Else
Range("C6:C29").Value = ""
Range("C6:C29").Interior.ColorIndex = 6 '<~~ Yellow Color
End If
End With
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jul 12th, 2010, 05:04 PM
#6
Thread Starter
Addicted Member
Re: [RESOLVED] color change the entire rows
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|