Code for multiple select of cells
Hi again,
Am Mon, 27 Oct 2014 08:21:59 +0100 schrieb Claus Busch:
another suggestion:
another suggestion:
Sub MultiSelect2()
Dim rngBig As Range, c As Range
Dim Firstaddress As String
With ActiveSheet.UsedRange
Set c = .Find(5, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
Firstaddress = c.Address
Do
If rngBig Is Nothing Then
Set rngBig = c
Else
Set rngBig = Union(rngBig, c)
End If
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < Firstaddress
End If
End With
rngBig.Select
End Sub
Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
|