Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Special Ranges of Cells

I have vb code that is doing a bunch of sorting crap, sorting data
pulled from a...you guessed it...database! Anyhoo, it sorts the order
data by the city that the orders ship out of, so this is the
information (happens to be the D column) that I use to do muh thing.
Unfortunaely, it sorts alphabetically, and it wouldn't be a problem,
except one stupid city is in the wrong county (all the others just
magically worked alphabetically). So, As the macro rips through the
sheet, it seperates by city and autosums and bolds some info, but I am
trying to ge it to cut this special city (we shall name it
"BOHICA-Town") and paste it at the end of the data, then go back to
where it was and continue. Unfortunately, since the number of orders
change every time you pull data, I need to try and figure out how to
name a variable range of rows to cut and paste. But the Range feature
only recognizes the A1 format...and I dun have that, because the
number are variable. Anyone have an idea of how I migt be able to do
this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Special Ranges of Cells

Not sure I follow but can you do a search on the column it
is in (looking for the particular city (selection.find
(what:=town, lookin:=xlvlaues, lookat:=xlwhole).select

then with that cell cut to to the bottom

rows(selection.row).cut destination:=rows(range
("A65536").end(xlup).row +1

then put it back when you finish?

Not sure of the exact coding but either someone else might
post a better solution or I am sure you can do a record
macro to find most of the code required

Jay
-----Original Message-----
I have vb code that is doing a bunch of sorting crap,

sorting data
pulled from a...you guessed it...database! Anyhoo, it

sorts the order
data by the city that the orders ship out of, so this is

the
information (happens to be the D column) that I use to do

muh thing.
Unfortunaely, it sorts alphabetically, and it wouldn't be

a problem,
except one stupid city is in the wrong county (all the

others just
magically worked alphabetically). So, As the macro rips

through the
sheet, it seperates by city and autosums and bolds some

info, but I am
trying to ge it to cut this special city (we shall name it
"BOHICA-Town") and paste it at the end of the data, then

go back to
where it was and continue. Unfortunately, since the

number of orders
change every time you pull data, I need to try and figure

out how to
name a variable range of rows to cut and paste. But the

Range feature
only recognizes the A1 format...and I dun have that,

because the
number are variable. Anyone have an idea of how I migt

be able to do
this?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Special Ranges of Cells

<<But the Range feature only recognizes the A1 format

Not true. Try

'--------------------------------------------------------------
ActiveSheet.Range(Cells(1, 1), Cells(5, 5)).Select
'--------------------------------------------------------------

You can replace the hardcoded numbers with variables

--
Message posted from http://www.ExcelForum.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
FormatCellsSpecialZip Code MichaelRobert Excel Worksheet Functions 6 May 14th 08 09:46 PM
Format cells for special characters Mad Davy Cash New Users to Excel 1 March 8th 07 09:51 PM
Name Ranges: Function to convert special characters underscores Calanbraun Excel Worksheet Functions 2 August 20th 06 07:05 AM
Go to Special Visible cells only Epinn New Users to Excel 1 August 9th 06 06:41 PM
How do you count (not sum) cells containing special formatting? tbank Excel Worksheet Functions 1 October 12th 05 10:13 PM


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