View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Colin Hayes Colin Hayes is offline
external usenet poster
 
Posts: 465
Default Selecting all the active cells in a named column.

In article , Dave Peterson
writes
Do you use merged cells?

If yes, then don't select a merged cell/range when prompted.

If you can't do that, you're going to have to share how the program should know
what cell in the merge area should define that column.

If you don't use merged cells, then I think something else went bad.

Did you change the code and not share your changes?

You should be using your mouse to select a cell?

Are you selecting more than one cell?


Hi Dave

Thanks for getting back.

No , no merged cells.

Only one cell is selected by mouse, be it randomly or in the column I'm
going to choose.

When I choose the target column via the macro popup , it selects a
different one (I enter 'G' and it selects column N) or crashes out with
an error. Very mysterious.

I've not made any changes to the code and have implemented it entirely
as shown.

It just needs to select all cells with content in the column specified
in the popup.

Best Wishes




Colin Hayes wrote:

Hi Dave

OK Thanks for this. It does the job.

Unfortunately though , when I specify column J via the popup , it
selects D. When I specify I , it selects C.

Also , when I specify other columns , I get 'The formula you typed
contains errors...' issues.

Could you helps with this , please?

Also , it would be helpful if it could highlight starting with cell 2 in
the chosen column.

Thanks again.

In article , Dave Peterson
writes
If you want a macro to ask the user...

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

Set myCell = Nothing
On Error Resume Next
Set myCell = Application.InputBox(Prompt:="Please select a column", _
Type:=8).Cells(1)
On Error GoTo 0

If myCell Is Nothing Then
Beep 'user hit cancel
Exit Sub
End If

With myCell.Parent
Set myRng = .Range(.Cells(1, myCell.Column), _
.Cells(.Rows.Count, myCell.Column).End(xlUp))
End With

Application.Goto myRng

End Sub

Colin Hayes wrote:

Hi

I have a small problem. I need to have a macro which can fulfil the
following , if possible.

I need to select all the cells in a named column. Not the whole column ,
but just those cells with content.

Perhaps the macro could request the column to act on , and then the
macro would select from cell 1 down to the last cell with content.

Can someone help with this?

Grateful for any advice.

Best Wishes