View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joemeshuggah joemeshuggah is offline
external usenet poster
 
Posts: 96
Default select range with resize

i am trying to build a macro that will highlight the cell double clicked and
the cell to the right of it , but cant seem to be able to get the resize to
work...here is what i have without the resize...


Option Explicit







Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)

Dim TheRange As Range
Dim oCell As Range
Dim Test As String





Test = Target.Value



Set TheRange = Range("A1:e200").SpecialCells( _
xlCellTypeConstants, xlTextValues)

For Each oCell In TheRange
If oCell.Text < Test Then
oCell.Font.Bold = False
oCell.Interior.ColorIndex = 0


End If
Next oCell


For Each oCell In TheRange
If oCell.Text = Test Then
oCell.Font.Bold = True
oCell.Interior.ColorIndex = 5

End If

Next oCell

Set TheRange = Range("A1:b200").SpecialCells( _
xlCellTypeConstants, xlNumbers)

For Each oCell In TheRange
If oCell.Text < Test Then
oCell.Font.Bold = False
oCell.Interior.ColorIndex = 0

End If
Next oCell


For Each oCell In TheRange
If oCell.Text = Test Then
oCell.Font.Bold = True
oCell.Interior.ColorIndex = 5

End If

Next oCell

Range("A1").Select




End Sub