Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default range selection

Hi ,
"A:A, F:F, AC:AC". those 3 columns have a different numbers of rows in each file. let's say x identify the last row.
how do I now select this range to apply a specific format.

I though something like "A1:A" & x but this works only for one column.
How do I select all ?

thanks
douvid
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default range selection

Hi Douvid,

Is this what you want?

Dim sRange As String
sRange = "A1:A" & Cells(Rows.Count, "A").End(xlUp).Row & "," & _
"F1:F" & Cells(Rows.Count, "F").End(xlUp).Row & "," & _
"AC1:AC" & Cells(Rows.Count, "AC").End(xlUp).Row
Range(sRange).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"douvid" wrote in message
...
Hi ,
"A:A, F:F, AC:AC". those 3 columns have a different numbers of rows in

each file. let's say x identify the last row.
how do I now select this range to apply a specific format.

I though something like "A1:A" & x but this works only for one column.
How do I select all ?

thanks
douvid



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default range selection

one way:

With Range("A1:A" & x & ",F1:F" & x & ",AC1:AC" & x)
.Interior.ColorIndex = 3
.NumberFormat = "@"
.Font.ColorIndex = 6
End With

In article ,
douvid wrote:

Hi ,
"A:A, F:F, AC:AC". those 3 columns have a different numbers of rows in each
file. let's say x identify the last row.
how do I now select this range to apply a specific format.

I though something like "A1:A" & x but this works only for one column.
How do I select all ?

thanks
douvid

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
VBA - Selection Instead of Range Cue Excel Discussion (Misc queries) 2 January 15th 10 05:08 PM
Range selection Naveen Excel Discussion (Misc queries) 3 October 9th 07 02:34 PM
Narrow Range based on Selection in Another Range David Excel Discussion (Misc queries) 3 July 1st 07 05:12 PM
Identifying a selection of a selection of a range swimfast Excel Worksheet Functions 1 March 1st 07 02:51 AM
Range Selection cfspahn24 Excel Discussion (Misc queries) 3 April 14th 06 01:29 PM


All times are GMT +1. The time now is 12:05 PM.

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"