Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cells not changing selection after sheets array

Hi Guys!

I have a macro that selects all sheets in an array, and then inputs th
value from a user form in the selected cell, but when i select anothe
cell on another sheet the activecell reverts to the last on
used.....any ideas on how to cure this

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cells not changing selection after sheets array

You can only select a cell on the active sheet.

--
Regards,
Tom Ogilvy

"Simon Lloyd " wrote in message
...
Hi Guys!

I have a macro that selects all sheets in an array, and then inputs the
value from a user form in the selected cell, but when i select another
cell on another sheet the activecell reverts to the last one
used.....any ideas on how to cure this?


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cells not changing selection after sheets array

Hi Tom,

Thanks for the reply, i want to be able to select a cell on any shee
and when i do (within a range of couurse) i want all sheets to b
selected but when they are all selected the initial cell i chose need
to be the active one even if it appears on the activ
sheet....something like......choose cell f34 on sheet3 (of say 5....
have more than this) then it should select all sheets and the activ
cell should stay F34 but when all are selected the last active cell o
the sheet in view is selected???

I have a very short version of the workbook (only 3 sheets) that i ca
send you if you want to see the problem....if you choose the firs
sheet make a selection in the range I3:H200 a userform appears make an
selection you like......now choose sheet2 and click a cell in the sam
range....all sheets select but you will now find the cursor has jumpe
to the cell you first used on sheet1...i cant figure it out

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default cells not changing selection after sheets array

As I said, the selected cell must be on the activesheet.

If you select all sheets, then you would have to rearrange the order of your
array so the sheet you want as the activesheet is the first element.

for example, if I want to use the activecell on sheet3 as the activecell for
all the sheets in the group and I want to group all sheets, then I would do
this: (6 sheets in the workbook).

Sub AATester2()
Dim Varr as Variant
varr = Array("Sheet3", "Sheet2", "Sheet4", _
"Sheet1", "Sheet5", "Sheet6")
Worksheets(varr).Select
End Sub

If I have at least one sheet not selected, then I can use an approach like
this: (one of the sheets that will be grouped must be selected when you run
this).

Sub AAtester1()
Dim cell as Range, varr as Variant
Set cell = ActiveCell
varr = Array("Sheet1", "Sheet2", "Sheet3", _
"Sheet4", "Sheet5")
Worksheets(varr).Select
Application.Goto cell
End Sub


--
Regards,
Tom Ogilvy


"Simon Lloyd " wrote in message
...
Hi Tom,

Thanks for the reply, i want to be able to select a cell on any sheet
and when i do (within a range of couurse) i want all sheets to be
selected but when they are all selected the initial cell i chose needs
to be the active one even if it appears on the active
sheet....something like......choose cell f34 on sheet3 (of say 5....i
have more than this) then it should select all sheets and the active
cell should stay F34 but when all are selected the last active cell on
the sheet in view is selected???

I have a very short version of the workbook (only 3 sheets) that i can
send you if you want to see the problem....if you choose the first
sheet make a selection in the range I3:H200 a userform appears make any
selection you like......now choose sheet2 and click a cell in the same
range....all sheets select but you will now find the cursor has jumped
to the cell you first used on sheet1...i cant figure it out!


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default cells not changing selection after sheets array

Tom,

Prior to using a userform i used a listbox, this worked fine when
used validation, allow list......when i selected a cell i would get
listbox dropdown list and the macro on each sheet was to select al
sheets....this worked fine and your selection would go where you put i
and would be in the same place across all sheets...but now i have go
the program looking smarter using a userform it doesnt work right...
have mailed you a short rip off from my 21 sheet workbook, as it i
780k which is too big for this forum.

Simo

--
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
AUTOMATICALLY CHANGING DATA FROM CELLS ON DIFF SHEETS VROSARIO7 Excel Worksheet Functions 2 July 2nd 09 01:24 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
How do I drag a formula keeping cells the same but changing sheets Claire Excel Worksheet Functions 2 October 30th 07 12:16 PM
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM
Changing Selection for the "Center Across Selection" alignment johnandsuzie Excel Discussion (Misc queries) 1 January 18th 06 04:48 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"