Sort by rows...

  • Thread starter Thread starter Darin Kramer
  • Start date Start date
D

Darin Kramer

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
 
Dim rng as Range
set rng = Range("A1",Cells(1,256).End(xltoLeft))
msgbox Rng.Address
 
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!!
 
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)).Entirecolumn.Select

are you using a right to left version of Excel?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top