Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default selecting data in a row

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.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,533
Default selecting data in a row

HI

Look at this:

Dim Rng2 As Range
With Worksheets("Data")
Set rng = .Range("a2", .Range("a" & Columns.Count).End(xlToLeft))
End With

Regards,
Per


"darkblue" skrev i meddelelsen
...
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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default selecting data in a row

On Feb 6, 4:54*pm, "Per Jessen" wrote:
HI

Look at this:

Dim Rng2 As Range
With Worksheets("Data")
* * * *Set rng = .Range("a2", .Range("a" & Columns.Count).End(xlToLeft))
End With

Regards,
Per

"darkblue" skrev i ...



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 so much Per.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default selecting data in a row

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.

.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
data selecting climate Excel Worksheet Functions 2 November 4th 08 05:45 AM
Selecting Data ckane Excel Discussion (Misc queries) 1 October 29th 08 05:53 PM
Selecting most recent data within several lines of data wilson@irco Excel Discussion (Misc queries) 0 June 19th 08 07:03 PM
Pivot charts - data disappear after selecting or data are static Patricia Maklari Excel Worksheet Functions 0 July 24th 07 01:36 PM
Selecting data cyc Excel Worksheet Functions 1 August 3rd 06 01:51 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"