Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default select multiple cells

Good morning from Mexico.
I need help on this Macro.
I am comapring one in sheet 1 the other in sheet 2
if this are diferant I need them to change the font color & background of
the two cells.

this is what I have but can't , this changes the color in one of the cell
but the other does not change

Sub crosscheck()

'Dim crosscheck As Double
'crosscheck worksheets for out of balance shedules

dblCheck = Abs(Sheets("AvgPrice NA").Range("d17").Value -
Sheets("SalesAnalysis NAGDO").Range("d90").Value)
If dblCheck 0 Then
Sheets("AvgPrice NA").Select
Range("d17").Activate
Sheets("SalesAnalysis NAGDO").Select
Range("d90").Activate
With Selection.Font
.ColorIndex = 3
End With
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With


End If


End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default select multiple cells


'Dim crosscheck As Double
'crosscheck worksheets for out of balance shedules

dblCheck = Abs(Sheets("AvgPrice NA").Range("d17").Value -
Sheets("SalesAnalysis NAGDO").Range("d90").Value)
If dblCheck 0 Then
Sheets("AvgPrice NA").Select
Range("d17").Activate
Sheets("SalesAnalysis NAGDO").Select
With Selection.Font
.ColorIndex = 3
End With
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With

Range("d90").Activate
With Selection.Font
.ColorIndex = 3
End With
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With


End If
End Sub

--
Regards,
Tom Ogilvy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default select multiple cells

Sub crosscheck()

'Dim crosscheck As Double
'crosscheck worksheets for out of balance shedules

dblCheck = Abs(Sheets("AvgPrice NA").Range("d17").Value -
Sheets("SalesAnalysis NAGDO").Range("d90").Value)
If dblCheck 0 Then
with Sheets("AvgPrice NA").Range("d17")
.Font .ColorIndex = 3
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With

WithSheets("SalesAnalysis NAGDO").Range("d90")

.Font .ColorIndex = 3
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With

End If


End Sub


--

HTH

RP

"Mestrella31" wrote in message
...
Good morning from Mexico.
I need help on this Macro.
I am comapring one in sheet 1 the other in sheet 2
if this are diferant I need them to change the font color & background of
the two cells.

this is what I have but can't , this changes the color in one of the cell
but the other does not change

Sub crosscheck()

'Dim crosscheck As Double
'crosscheck worksheets for out of balance shedules

dblCheck = Abs(Sheets("AvgPrice NA").Range("d17").Value -
Sheets("SalesAnalysis NAGDO").Range("d90").Value)
If dblCheck 0 Then
Sheets("AvgPrice NA").Select
Range("d17").Activate
Sheets("SalesAnalysis NAGDO").Select
Range("d90").Activate
With Selection.Font
.ColorIndex = 3
End With
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With


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
how dod I NOT select multiple cells at the same time ashleyb Excel Discussion (Misc queries) 2 April 19th 10 11:08 PM
Select multiple adjacent cells of multiple cells without selecting sjsjsjsjsjs New Users to Excel 11 December 24th 09 01:09 AM
Select multiple adjacent cells of multiple cells without selecting sjsjsjsjsjs Excel Worksheet Functions 7 December 23rd 09 08:54 PM
trying to select multiple cells marrie New Users to Excel 7 September 11th 06 05:09 PM
Why aren't my cells highlighted when I select multiple cells? TChristian Setting up and Configuration of Excel 0 January 26th 05 10:23 PM


All times are GMT +1. The time now is 02:31 PM.

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

About Us

"It's about Microsoft Excel"