Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rebecca Shearer
 
Posts: n/a
Default set up a macro in Excel to color cells when clicked

I would liketo create a spreasheet that will highlight the value in the first
column if there ia value in another column of the same row.
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Sub Test
Dim iLastRow As Long
Dim i As Long

For i = 1 To UsedRange.Rows.Count
If Application.Count(Range("B" & i).Resize(,255)) 0 Then
Cells(i,"A").Interior.Colorindex = 36
End If
Next i

End Sub

--
HTH

Bob Phillips

"Rebecca Shearer" <Rebecca wrote in
message ...
I would liketo create a spreasheet that will highlight the value in the

first
column if there ia value in another column of the same row.



  #3   Report Post  
Rebecca Shearer
 
Posts: n/a
Default

Could you give me a little more instructions with this Macro? Where am I
suppose to insert the lines to be used?

Thanks.
rebecca

"Bob Phillips" wrote:

Sub Test
Dim iLastRow As Long
Dim i As Long

For i = 1 To UsedRange.Rows.Count
If Application.Count(Range("B" & i).Resize(,255)) 0 Then
Cells(i,"A").Interior.Colorindex = 36
End If
Next i

End Sub

--
HTH

Bob Phillips

"Rebecca Shearer" <Rebecca wrote in
message ...
I would liketo create a spreasheet that will highlight the value in the

first
column if there ia value in another column of the same row.




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Hi Rebecca,

Thinking about this, I now think it is better to use conditional formatting.

Select A1 through to An for all relevant rows

Menu FormatConditional Formatting
Change Condition 1 to Formula Is
Add this formula =COUNTA(B1:IV1)0
Click Format
Select the pattern tab
Choose an acceptable highlight colour
OK
OK

Should now work okay

--
HTH

Bob Phillips

"Rebecca Shearer" wrote in
message ...
Could you give me a little more instructions with this Macro? Where am I
suppose to insert the lines to be used?

Thanks.
rebecca

"Bob Phillips" wrote:

Sub Test
Dim iLastRow As Long
Dim i As Long

For i = 1 To UsedRange.Rows.Count
If Application.Count(Range("B" & i).Resize(,255)) 0 Then
Cells(i,"A").Interior.Colorindex = 36
End If
Next i

End Sub

--
HTH

Bob Phillips

"Rebecca Shearer" <Rebecca wrote in
message ...
I would liketo create a spreasheet that will highlight the value in

the
first
column if there ia value in another column of the same row.






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
Excel macro that opens new MS Word file and pastes data as a pictu Rob Excel Worksheet Functions 0 July 6th 05 05:12 PM
Can't find macro in an Excel file to delete it Ron Excel Discussion (Misc queries) 3 July 1st 05 01:07 PM
Saving Excel using Macro mrbalaje Excel Discussion (Misc queries) 4 April 20th 05 02:32 PM
How can I edit cell contents with a macro in Excel? Mind the gaps! Excel Discussion (Misc queries) 2 March 23rd 05 08:51 PM
Problem Editing Macro in Shared Excel File [email protected] Excel Discussion (Misc queries) 1 March 19th 05 06:43 PM


All times are GMT +1. The time now is 03:22 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"