Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Range("Defined Name").Sort

Hi

You can use the VBA level sheet names. Look in the project explorer window,
for each sheet you will see two sheet names:

Sheet1(MySheetName)

where Sheet1 is the VBA level sheet name and MySheetName is the visible
sheet name on the sheet tab, which you are changeing.

Using the first, you don't use the Worksheet(..) reference, just

Sheet1.Range("...")

Hopes this helps.

Regards,
Per


skrev i meddelelsen
...
Well, I figured it out. Thanks for your help. In the properties of
the worksheet, the (name) is "wksJobCostInput", but the name is "JC -
Tenant Alterations". It turns out when I do this:

Worksheets("wksJobCostInput").Range("valJobCostEnt ryList"), it can't
find the range, but when I do this:

Worksheets("JC - Tenant Alterations").Range("valJobCostEntryList")

it can find it no problem. That kind of sucks, because I plan on
changing the visible name at some point, and I will have to go into my
code and adjust all of the references. Does anyone know if this is a
known issue?

Michael

p.s. thanks for the heads up about spammers getting my e-mail
address. I am using google groups to post, and it doesn't seem to
allow me to change it. Well, I guess I'll just have to hope gmail
catches all of the spam.

On Jul 13, 5:55 pm, "Jim Cone" wrote:
Try changing the keys to...
Key1:=Range("valJobCostEntryList").Columns(1) 'whatever corresponds to
column E
and so on for Key2 and Key3

Note: Spammers harvest email addresses from newsgroups, I'm told.
--
Jim Cone
Portland, Oregon USA
(remove xxx)
(Free trial of Special Sort Excel add-in - two dozen ways to sort)


wrote in message
I am getting a "Subscript out of range" error trying to run a simple
bit of code. This is the code, essentially:

Range("valJobCostEntryList").Sort _
Key1:=Worksheets("wksJobCostInput").Range("E8"), _
Key2:=Worksheets("wksJobCostInput").Range("G8"), _
Key3:=Worksheets("wksJobCostInput").Range("H8")

I have tried including Worksheets("wksJobCostInput"). before Range,
and I have tried the following line of code:

Range("valJobCostEntryList").Select

which works just fine. I can't use select, however, because I am
capturing that Event to bring up a dialog box, and I don't want to
call the dialog box, just to sort the darned range!

Can anyone help me please?


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
Missing sort ascending or descending when go into "data" "sort"? Jason Excel Discussion (Misc queries) 5 September 17th 08 11:57 PM
Jump to "Defined name" range! [email protected] Excel Programming 8 June 15th 06 10:21 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
"Application-defined or object-defined error" while printing excel report chemburkar Excel Programming 0 February 2nd 04 08:33 PM


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