selecting like cells in a column

  • Thread starter Thread starter wolfpack95
  • Start date Start date
W

wolfpack95

First time poster...wish I would have found this place a long time ago!

I need to select 'like' cells (i.e. same value) from a column (for use
in a macro so I can't just point and click). The like cells are
actually grouped together. Sounds easy enough but I can't find a
shortcut key to do it and am trying to avoid writing vb for this part
of the task.


Please help!!



------------------------------------------------
Message posted

-- View and post Excel related usenet messages directly from http://www.ExcelForum.com
at http://www.ExcelTip.com/
------------------------------------------------
 
The reason you can't point and click in the macro is because you don't want to
have to select the cells each time the macro runs????

Maybe you could select the range, then run the macro. Or even pause for the
range:

Option Explicit
Sub testme()

Dim myRng As Range
On Error Resume Next
Set myRng = Application.InputBox(prompt:="point at that range", Type:=8)
On Error GoTo 0
If myRng Is Nothing Then
'user hit cancel
Exit Sub
End If

Set myRng = myRng.Areas(1).Columns(1)
MsgBox myRng.Address

myRng.Copy _
Destination:=Worksheets("sheet2").Range("b3") 'for example?

End Sub

If you're macro knows what cell to start, you could drop through that range
until you find a difference.

And this has never proved too valuable to me, but try this.

Select that column (or subset of that column).
then hit ctrl-shift-| (broken vertical bar)
hit it again. That's kind of neat, but I bet it doesn't fit your needs. (But
it's a neat way to get to the next set of differences.)

It's the same thing as Edit|goto|special|Column differences. (If your data only
varied between two values, it might be ok.)
 
Back
Top