View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default What is the proper dot.syntax to insert a select case within a With / End With Statement

Try...

Dim LRow As Long
With Sheets("Alpha")
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
Select Case CLng(.Range("A2:A" & LRow).Value)
Case Is < 63 'If CostCode is < "063" Numbers as Text
'Do this
Case 304
'Do that
Case 386
Select Case .Range("B2:B" & LRow).Value
Case "Martin"
'Do This
Case "Charles"
'Do That
End Select
End Select
End With

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion