Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Sort by rows...


Hi there,

I got data in columns a onwards (could go up to AZ, and any variable
number of columns between a and az)I need VB to
to sort the data by ROWS, and basic VB seems to sort the data fine
however I loose the cell formatting (border) of the sorted data.
Does anyone have some VB to do the above and maintain the cell
formatting.?

Alternatively, I could copy and paste the cell formatting from another
sheet, (say column A in sheet B) and paste formatting over the existing
data in my original sheet, but I need to then find last column with data
in it (ie from column A how do I find last column with data in it, and
then select column A up to and including that last column...?)

Thanks!!!!!

Darin

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort by rows...

Dim rng as Range
set rng = Range("A1",Cells(1,256).End(xltoLeft))
msgbox Rng.Address

--
Regards,
Tom Ogilvy


"Darin Kramer" wrote in message
...

Hi there,

I got data in columns a onwards (could go up to AZ, and any variable
number of columns between a and az)I need VB to
to sort the data by ROWS, and basic VB seems to sort the data fine
however I loose the cell formatting (border) of the sorted data.
Does anyone have some VB to do the above and maintain the cell
formatting.?

Alternatively, I could copy and paste the cell formatting from another
sheet, (say column A in sheet B) and paste formatting over the existing
data in my original sheet, but I need to then find last column with data
in it (ie from column A how do I find last column with data in it, and
then select column A up to and including that last column...?)

Thanks!!!!!

Darin

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Sort by rows...

Thanks tom - Slight modification - Ive changed a1 to bz1. works fine,
but now I want to select the columns that my range has identifed (ie
currently selecting from bz1 until last piece of data assume h1 - so its
selecting bz1 to h1. I want to select the whole column BZ to I (not H!)
(ie the one next to H and also the whole column not just row 1

Thanks!!



*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sort by rows...

In my version of Excel (which is oriented Left to Right), h1 is to the left
of BZ1. I would do

Range("I1",cells(1,"IV").End(xltoLeft)).Entirecolu mn.Select

are you using a right to left version of Excel?

--
Regards,
Tom Ogilvy

"Darin Kramer" wrote in message
...
Thanks tom - Slight modification - Ive changed a1 to bz1. works fine,
but now I want to select the columns that my range has identifed (ie
currently selecting from bz1 until last piece of data assume h1 - so its
selecting bz1 to h1. I want to select the whole column BZ to I (not H!)
(ie the one next to H and also the whole column not just row 1

Thanks!!



*** Sent via Developersdex http://www.developersdex.com ***



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
Don't sort top two rows? Toney Excel Discussion (Misc queries) 2 January 27th 10 12:51 AM
Sort rows and move borders with rows [email protected] New Users to Excel 1 June 4th 09 07:36 AM
Sort with blank rows between data rows Sheila Excel Discussion (Misc queries) 1 November 21st 08 02:23 PM
Sort by color: Is there an easy way to sort columns or rows in EX MGP Excel Worksheet Functions 5 August 16th 08 11:28 AM
sort multiple rows without affecting others rows Nitya Excel Discussion (Misc queries) 0 August 10th 06 01:59 PM


All times are GMT +1. The time now is 01:46 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"