Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Mantaining ranges if several sheets are selected

Hi, I have a macro that takes all the ranges of the selected cells (in each
worksheet) and paste them wherever the user wants, the thing is when I select
two or more sheets the ranges of all the sheets are lost and in all the
sheets appears the range of the first sheet, how can I mantain the ranges in
all the selected sheets?
TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mantaining ranges if several sheets are selected


Firstly it would be helpful if you could post the code you are using,
secondly you don't say how you define the range in each sheet, when you
say selected sheets are you grouping them? if not by what means are you
or the user selecting them?

filo666;212818 Wrote:
Hi, I have a macro that takes all the ranges of the selected cells (in
each
worksheet) and paste them wherever the user wants, the thing is when I
select
two or more sheets the ranges of all the sheets are lost and in all the
sheets appears the range of the first sheet, how can I mantain the
ranges in
all the selected sheets?
TIA



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58415

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Mantaining ranges if several sheets are selected

the code is huge, impossible to paste it, simple:
the user selects range a1:a5 and range b3:c5 from sheet1, he selects range
g4:g6 and range v6:n9 from sheet2, he selects both sheets and the ranges of
sheet1 are lost.

"Simon Lloyd" wrote:


Firstly it would be helpful if you could post the code you are using,
secondly you don't say how you define the range in each sheet, when you
say selected sheets are you grouping them? if not by what means are you
or the user selecting them?

filo666;212818 Wrote:
Hi, I have a macro that takes all the ranges of the selected cells (in
each
worksheet) and paste them wherever the user wants, the thing is when I
select
two or more sheets the ranges of all the sheets are lost and in all the
sheets appears the range of the first sheet, how can I mantain the
ranges in
all the selected sheets?
TIA



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58415


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mantaining ranges if several sheets are selected


Your code would need to be on the lines of:
Code:
--------------------
Dim Sh As Worksheet
For each Sh in sheets
with selection
'do something with the selected range
End with
--------------------

If you would like to show a workbook you can join the forum shown below
for free, when making a post you can attach a workbook prior to
submitting your post, if you do join and post a question related to this
one please post it in this thread (link can be found below) so that
others who have been helping or following the thread can still do so.

filo666;212943 Wrote:
the code is huge, impossible to paste it, simple:
the user selects range a1:a5 and range b3:c5 from sheet1, he selects
range
g4:g6 and range v6:n9 from sheet2, he selects both sheets and the
ranges of
sheet1 are lost.

"Simon Lloyd" wrote:


Firstly it would be helpful if you could post the code you are using,
secondly you don't say how you define the range in each sheet, when

you
say selected sheets are you grouping them? if not by what means are

you
or the user selecting them?

filo666;212818 Wrote:
Hi, I have a macro that takes all the ranges of the selected cells

(in
each
worksheet) and paste them wherever the user wants, the thing is

when I
select
two or more sheets the ranges of all the sheets are lost and in all

the
sheets appears the range of the first sheet, how can I mantain the
ranges in
all the selected sheets?
TIA



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Mantaining ranges if several sheets are selected -

The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=58415)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58415

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default Mantaining ranges if several sheets are selected

I already have that part in my code, let me try to explain my self better:

Could you do this please:

1)select range("A1:A6") in sheet1
2)select range("v1:v6") in sheet2
3)select sheet1 and sheet2 (with key shift presed and cliking with your mouse)
4) now enter to sheet1 or to sheet2, you will find out that one of your
ranges was lost!!!!


"Simon Lloyd" wrote:


Your code would need to be on the lines of:
Code:
--------------------
Dim Sh As Worksheet
For each Sh in sheets
with selection
'do something with the selected range
End with
--------------------

If you would like to show a workbook you can join the forum shown below
for free, when making a post you can attach a workbook prior to
submitting your post, if you do join and post a question related to this
one please post it in this thread (link can be found below) so that
others who have been helping or following the thread can still do so.

filo666;212943 Wrote:
the code is huge, impossible to paste it, simple:
the user selects range a1:a5 and range b3:c5 from sheet1, he selects
range
g4:g6 and range v6:n9 from sheet2, he selects both sheets and the
ranges of
sheet1 are lost.

"Simon Lloyd" wrote:


Firstly it would be helpful if you could post the code you are using,
secondly you don't say how you define the range in each sheet, when

you
say selected sheets are you grouping them? if not by what means are

you
or the user selecting them?

filo666;212818 Wrote:
Hi, I have a macro that takes all the ranges of the selected cells

(in
each
worksheet) and paste them wherever the user wants, the thing is

when I
select
two or more sheets the ranges of all the sheets are lost and in all

the
sheets appears the range of the first sheet, how can I mantain the
ranges in
all the selected sheets?
TIA


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Mantaining ranges if several sheets are selected -

The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=58415)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58415




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mantaining ranges if several sheets are selected


Thats Excel working perfect!, its supposed to do that as it assumes that
because you have "Grouped" the sheets you want to perform a single
action without having to edit each sheet individually, if you have
something like the code i supplied then you don't need to group the
sheets, if its because you only want it to happen on a few sheets rather
than all then simply use an Array.

filo666;213005 Wrote:
I already have that part in my code, let me try to explain my self
better:

Could you do this please:

1)select range("A1:A6") in sheet1
2)select range("v1:v6") in sheet2
3)select sheet1 and sheet2 (with key shift presed and cliking with your
mouse)
4) now enter to sheet1 or to sheet2, you will find out that one of your
ranges was lost!!!!


"Simon Lloyd" wrote:


Your code would need to be on the lines of:
Code:
--------------------
Dim Sh As Worksheet
For each Sh in sheets
with selection
'do something with the selected range
End with
--------------------

If you would like to show a workbook you can join the forum shown

below
for free, when making a post you can attach a workbook prior to
submitting your post, if you do join and post a question related to

this
one please post it in this thread (link can be found below) so that
others who have been helping or following the thread can still do so.

filo666;212943 Wrote:
the code is huge, impossible to paste it, simple:
the user selects range a1:a5 and range b3:c5 from sheet1, he

selects
range
g4:g6 and range v6:n9 from sheet2, he selects both sheets and the
ranges of
sheet1 are lost.

"Simon Lloyd" wrote:


Firstly it would be helpful if you could post the code you are

using,
secondly you don't say how you define the range in each sheet,

when
you
say selected sheets are you grouping them? if not by what means

are
you
or the user selecting them?

filo666;212818 Wrote:
Hi, I have a macro that takes all the ranges of the selected

cells
(in
each
worksheet) and paste them wherever the user wants, the thing is
when I
select
two or more sheets the ranges of all the sheets are lost and in

all
the
sheets appears the range of the first sheet, how can I mantain

the
ranges in
all the selected sheets?
TIA


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' ('The Code Cage'

(http://www.thecodecage.com)))


------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile:

Simon
Lloyd' ('The Code Cage Forums - View Profile: Simon Lloyd'

(http://www.thecodecage.com/forumz/member.php?userid=1))
View this thread: 'Mantaining ranges if several sheets are

selected -
The Code Cage Forums'
('Mantaining ranges if several sheets are selected - The Code Cage

Forums' (http://www.thecodecage.com/forumz/sh...d.php?t=58415))




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Mantaining ranges if several sheets are selected -

The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...ad.php?t=58415)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=58415

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
Copy Two Visible Ranges (From Two Sheets) To A New Workbook (AlsoWith Two Sheets) [email protected] Excel Programming 2 January 29th 09 08:39 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Programming 6 March 29th 06 12:43 PM
mantaining formula when inserting col George Excel Discussion (Misc queries) 4 October 17th 05 07:02 PM
named ranges - changing ranges with month selected gr8guy Excel Programming 2 May 28th 04 04:50 AM


All times are GMT +1. The time now is 02:01 AM.

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"