Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default did I uncheck something?!?!

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i perhaps
uncheck some option somewhere that somebody can think of?! i've looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default did I uncheck something?!?!

A couple of things...

1. This line of code is mighty unpredicatable...
set bldgs = activeworkbook.worksheets(1)
Whatever might happend to be the first sheet in whatever might be the active
workbook at the time will be the object bldgs... This is open to problems if
you start woring with multiple workbooks of if you add or delete sheets from
the active workbook. A better line would be
set bldgs = thisworkbook.worksheets("MySpecialSheet")

2. In order to select a range on a sheet that sheet must first be the active
sheet so you want something more like

with bldgs
..select
..range("a4").select
end with

--
HTH...

Jim Thomlinson


"Susan" wrote:

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i perhaps
uncheck some option somewhere that somebody can think of?! i've looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default did I uncheck something?!?!

thanks for the help, guys.
perhaps i misunderstood a concept....... i thought that once you
declared a variable & set it, you could do whatever you wanted with it
without selecting it, or the sheet it is on. yes, the general "A4"
obviously wouldn't work, but.................

dim rng1 as variant
dim bldgs as worksheet

set bldgs = thisworkbook.worksheets("MySpecialSheet")
set rng1 = bldgs.range("a5:c10")

rng1.select (copy, sort, print, etc.)

at this point, i was under the impression that you could do almost
anything with rng1 without selecting the specific worksheet first,
since the range had been declared & set. even if you wanted to enter
info into that range, it would put it in the correct place because it
was declared & set.

was i completely off base?
thanks for your kind explanations & assistance.
susan

Jim Thomlinson wrote:
A couple of things...

1. This line of code is mighty unpredicatable...
set bldgs = activeworkbook.worksheets(1)
Whatever might happend to be the first sheet in whatever might be the active
workbook at the time will be the object bldgs... This is open to problems if
you start woring with multiple workbooks of if you add or delete sheets from
the active workbook. A better line would be
set bldgs = thisworkbook.worksheets("MySpecialSheet")

2. In order to select a range on a sheet that sheet must first be the active
sheet so you want something more like

with bldgs
.select
.range("a4").select
end with

--
HTH...

Jim Thomlinson


"Susan" wrote:

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i perhaps
uncheck some option somewhere that somebody can think of?! i've looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default did I uncheck something?!?!

why not, as I suggested

set bldgs = thisworkbook.worksheets("MySpecialSheet")
application.goto = bldgs.range("a5:c10")


--
Don Guillett
SalesAid Software

"Susan" wrote in message
ups.com...
thanks for the help, guys.
perhaps i misunderstood a concept....... i thought that once you
declared a variable & set it, you could do whatever you wanted with it
without selecting it, or the sheet it is on. yes, the general "A4"
obviously wouldn't work, but.................

dim rng1 as variant
dim bldgs as worksheet

set bldgs = thisworkbook.worksheets("MySpecialSheet")
set rng1 = bldgs.range("a5:c10")

rng1.select (copy, sort, print, etc.)

at this point, i was under the impression that you could do almost
anything with rng1 without selecting the specific worksheet first,
since the range had been declared & set. even if you wanted to enter
info into that range, it would put it in the correct place because it
was declared & set.

was i completely off base?
thanks for your kind explanations & assistance.
susan

Jim Thomlinson wrote:
A couple of things...

1. This line of code is mighty unpredicatable...
set bldgs = activeworkbook.worksheets(1)
Whatever might happend to be the first sheet in whatever might be the
active
workbook at the time will be the object bldgs... This is open to problems
if
you start woring with multiple workbooks of if you add or delete sheets
from
the active workbook. A better line would be
set bldgs = thisworkbook.worksheets("MySpecialSheet")

2. In order to select a range on a sheet that sheet must first be the
active
sheet so you want something more like

with bldgs
.select
.range("a4").select
end with

--
HTH...

Jim Thomlinson


"Susan" wrote:

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i perhaps
uncheck some option somewhere that somebody can think of?! i've looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default did I uncheck something?!?!

yes, don, i can certainly do that. it just seems that it would make
for a lot of extra coding in a large macro.
but if that's what i have to do, then that's what i'll do. i guess i
just misunderstood the concept.
:)
thank you!
susan

Don Guillett wrote:
why not, as I suggested

set bldgs = thisworkbook.worksheets("MySpecialSheet")
application.goto = bldgs.range("a5:c10")


--
Don Guillett
SalesAid Software

"Susan" wrote in message
ups.com...
thanks for the help, guys.
perhaps i misunderstood a concept....... i thought that once you
declared a variable & set it, you could do whatever you wanted with it
without selecting it, or the sheet it is on. yes, the general "A4"
obviously wouldn't work, but.................

dim rng1 as variant
dim bldgs as worksheet

set bldgs = thisworkbook.worksheets("MySpecialSheet")
set rng1 = bldgs.range("a5:c10")

rng1.select (copy, sort, print, etc.)

at this point, i was under the impression that you could do almost
anything with rng1 without selecting the specific worksheet first,
since the range had been declared & set. even if you wanted to enter
info into that range, it would put it in the correct place because it
was declared & set.

was i completely off base?
thanks for your kind explanations & assistance.
susan

Jim Thomlinson wrote:
A couple of things...

1. This line of code is mighty unpredicatable...
set bldgs = activeworkbook.worksheets(1)
Whatever might happend to be the first sheet in whatever might be the
active
workbook at the time will be the object bldgs... This is open to problems
if
you start woring with multiple workbooks of if you add or delete sheets
from
the active workbook. A better line would be
set bldgs = thisworkbook.worksheets("MySpecialSheet")

2. In order to select a range on a sheet that sheet must first be the
active
sheet so you want something more like

with bldgs
.select
.range("a4").select
end with

--
HTH...

Jim Thomlinson


"Susan" wrote:

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i perhaps
uncheck some option somewhere that somebody can think of?! i've looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default did I uncheck something?!?!

Susan,
It's quite possible you don't need to goto the sheet at all.ie:

bldgs.range("a5:c10").copy range("a4")

--
Don Guillett
SalesAid Software

"Susan" wrote in message
ups.com...
yes, don, i can certainly do that. it just seems that it would make
for a lot of extra coding in a large macro.
but if that's what i have to do, then that's what i'll do. i guess i
just misunderstood the concept.
:)
thank you!
susan

Don Guillett wrote:
why not, as I suggested

set bldgs = thisworkbook.worksheets("MySpecialSheet")
application.goto = bldgs.range("a5:c10")


--
Don Guillett
SalesAid Software

"Susan" wrote in message
ups.com...
thanks for the help, guys.
perhaps i misunderstood a concept....... i thought that once you
declared a variable & set it, you could do whatever you wanted with it
without selecting it, or the sheet it is on. yes, the general "A4"
obviously wouldn't work, but.................

dim rng1 as variant
dim bldgs as worksheet

set bldgs = thisworkbook.worksheets("MySpecialSheet")
set rng1 = bldgs.range("a5:c10")

rng1.select (copy, sort, print, etc.)

at this point, i was under the impression that you could do almost
anything with rng1 without selecting the specific worksheet first,
since the range had been declared & set. even if you wanted to enter
info into that range, it would put it in the correct place because it
was declared & set.

was i completely off base?
thanks for your kind explanations & assistance.
susan

Jim Thomlinson wrote:
A couple of things...

1. This line of code is mighty unpredicatable...
set bldgs = activeworkbook.worksheets(1)
Whatever might happend to be the first sheet in whatever might be the
active
workbook at the time will be the object bldgs... This is open to
problems
if
you start woring with multiple workbooks of if you add or delete
sheets
from
the active workbook. A better line would be
set bldgs = thisworkbook.worksheets("MySpecialSheet")

2. In order to select a range on a sheet that sheet must first be the
active
sheet so you want something more like

with bldgs
.select
.range("a4").select
end with

--
HTH...

Jim Thomlinson


"Susan" wrote:

for some unknown reason, all of a sudden i can't make a macro
understand WHERE to perform tasks certain worksheets! things
that
USED to work are now not working, such as

dim bldgs as worksheet
set bldgs = activeworkbook.worksheets(1)
bldgs.range("a4").select

it selects "a4" on whatever sheet is currently active.
the only way i can make things work is to use

bldgs.Activate

before i do anything. this is not what it used to do! did i
perhaps
uncheck some option somewhere that somebody can think of?! i've
looked
@ excel options & see nothing strange now (although for some reason
"manual" calculations was checked [& i didn't check it]... have
fixed
that now).

if anybody has ideas, pls. let me know. i believe it is a
software/computer problem, not a macro problem.
thanks
susan






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
Uncheck a box Pietro Excel Discussion (Misc queries) 4 August 29th 07 11:48 AM
check/uncheck a checkbox leonidas[_38_] Excel Programming 3 July 6th 06 11:24 AM
Uncheck \View\Toolbars\... hccatmo Excel Programming 2 May 2nd 06 04:17 PM
Check / Uncheck Box Navy Chief Setting up and Configuration of Excel 1 October 3rd 05 01:54 AM
List box - how to uncheck box Anita Gray Excel Programming 1 June 23rd 04 11:52 PM


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