View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
darkblue darkblue is offline
external usenet poster
 
Posts: 35
Default selecting data in a row

On Feb 6, 5:31*pm, Mike H wrote:
Hi,

One way with the usual caveat that it is very unlikely you need to select
the range to do what you want.

Dim rng As Range
With Worksheets("Sheet1")
LastCol = .Cells(1, Columns.Count).End(xlToLeft).Column
Set rng = .Range(Cells(1, 1), Cells(1, LastCol))
End With
rng.Select

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.



"darkblue" wrote:
Dim rng As Range
With Worksheets("Data")
* * * *Set rng = .Range("a2", .Range("a" & Rows.count).End(xlUp))
End With
rng.Select
--------------------


With above code I select all data in column A.
How can I select all data in row 1.
I mean what is the equal code for selecting columns in a row ?
Thank you.


.- Hide quoted text -


- Show quoted text -


Thank you very much Mike.