View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Code for multiple select of cells

On Monday, October 27, 2014 12:30:31 AM UTC-7, Claus Busch wrote:
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.
--



Thanks Claus.

Really have some good stuff to work with.

Regards,
Howard