PC Review


Reply
Thread Tools Rate Thread

Can this be done with HIDE - UNHIDE ?

 
 
ytayta555
Guest
Posts: n/a
 
      11th Jun 2009
Hi All !

I have next macro , which move blocks of
data , in combinatoric order , from columns 11 to 20 ,
in columns 1 to 3 :

Sub moveblocksofdata ( )
Dim i1 As Integer
Dim i2 As Integer
Dim i3 As Integer

For i1 = 11 To 18
For i2 = i1 + 1 To 19
For i3 = i2 + 1 To 20
Range("A1:A203") = .Range(Cells("1", i1), _
Cells("203", i1)).Value
Range("B1:B203") = .Range(Cells("1", i2), _
Cells("203", i2)).Value
Range("C1:C203") = .Range(Cells("1", i3), _
Cells("203", i3)).Value
Next i3
Next i2
Next i1
End Sub

Can this be done in another way , useing hide - unhide method ?
I mean , let's be a block of data in a range ( from column 11
to column 20 ) ; can hide - unhide to do the exact result from
previous macro , so , all the time to be no more then 3 columns ?
In every step , must to be hide 7 columns .

I'd like very much and it's very usefull for me to get know if this
thing can be possible useing hide - unhide .

Thank you very much for your time and knowledge share !
 
Reply With Quote
 
 
 
 
Patrick Molloy
Guest
Posts: n/a
 
      11th Jun 2009
i don't understand your code. Your target is the same, so it continuously
gets overwritten in the loop. also you seem to confuse rows with columns ...
wel you confused me anyway.

if you want to "move" a table, you could do it this way:
dim source as range
dim target as range
set source = range("A1:L203"
set target = sheet2.Range("G1") ' a cell anywhere else

with source
target.resize(.rows.count,.columns.count).Value = .Value
.ClearContents
end with






"ytayta555" <(E-Mail Removed)> wrote in message
news:9f5021e3-6091-440d-93ce-(E-Mail Removed)...
> Hi All !
>
> I have next macro , which move blocks of
> data , in combinatoric order , from columns 11 to 20 ,
> in columns 1 to 3 :
>
> Sub moveblocksofdata ( )
> Dim i1 As Integer
> Dim i2 As Integer
> Dim i3 As Integer
>
> For i1 = 11 To 18
> For i2 = i1 + 1 To 19
> For i3 = i2 + 1 To 20
> Range("A1:A203") = .Range(Cells("1", i1), _
> Cells("203", i1)).Value
> Range("B1:B203") = .Range(Cells("1", i2), _
> Cells("203", i2)).Value
> Range("C1:C203") = .Range(Cells("1", i3), _
> Cells("203", i3)).Value
> Next i3
> Next i2
> Next i1
> End Sub
>
> Can this be done in another way , useing hide - unhide method ?
> I mean , let's be a block of data in a range ( from column 11
> to column 20 ) ; can hide - unhide to do the exact result from
> previous macro , so , all the time to be no more then 3 columns ?
> In every step , must to be hide 7 columns .
>
> I'd like very much and it's very usefull for me to get know if this
> thing can be possible useing hide - unhide .
>
> Thank you very much for your time and knowledge share !


 
Reply With Quote
 
ytayta555
Guest
Posts: n/a
 
      11th Jun 2009
On 11 Iun, 17:41, "Patrick Molloy" <patrick_mol...@hotmail.com> wrote:
> i don't understand your code.


Thanks for reply

>Your target is the same, so it continuously gets overwritten in the loop.

This is what I really need

>also you seem to confuse rows with columns ...

No , I'm not , if you put some data in Range K1:T203 ,
you will see the result of macro in range A1:C203 ;
I need this , to generate combinatoric situations

> if you want to "move" a table, you could do it this way:

I need to move parts of table ( mean columns )"in combinatoric
order" .
I'd just want to get ideas and answers if it can be done in
other way , for eg. how I asked , useing Hide and Unhide

Many thanks again
 
Reply With Quote
 
ytayta555
Guest
Posts: n/a
 
      12th Jun 2009
I'd like to know what are you thinking
about this problem , you are shure more
experimented like me .
 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      12th Jun 2009
Hi,

The answer is yes, it can be done. I'm not sure why you'd want to... Your
existing code takes all combinations of three columns from K to T and shows
them sequentially as A to C. I assume your code will do something to each
combination as it is shown, but that you haven't written it yet.

This does the same thing, but by hiding:

Sub hideblocksofdata ( )
Dim i As Integer
Dim j As Integer
Dim k As Integer

For i = 11 To 18
For j = i + 1 To 19
For k = j + 1 To 20
range("K1:T1").entirecolumn.hidden = true
range("a1").offset(0,i).entirecolumn.hidden = false
range("a1").offset(0,j).entirecolumn.hidden = false
range("a1").offset(0,k).entirecolumn.hidden = false
Next i3
Next i2
Next i1

End Sub


"ytayta555" wrote:

> Hi All !
>
> I have next macro , which move blocks of
> data , in combinatoric order , from columns 11 to 20 ,
> in columns 1 to 3 :
>
> Sub moveblocksofdata ( )
> Dim i1 As Integer
> Dim i2 As Integer
> Dim i3 As Integer
>
> For i1 = 11 To 18
> For i2 = i1 + 1 To 19
> For i3 = i2 + 1 To 20
> Range("A1:A203") = .Range(Cells("1", i1), _
> Cells("203", i1)).Value
> Range("B1:B203") = .Range(Cells("1", i2), _
> Cells("203", i2)).Value
> Range("C1:C203") = .Range(Cells("1", i3), _
> Cells("203", i3)).Value
> Next i3
> Next i2
> Next i1
> End Sub
>
> Can this be done in another way , useing hide - unhide method ?
> I mean , let's be a block of data in a range ( from column 11
> to column 20 ) ; can hide - unhide to do the exact result from
> previous macro , so , all the time to be no more then 3 columns ?
> In every step , must to be hide 7 columns .
>
> I'd like very much and it's very usefull for me to get know if this
> thing can be possible useing hide - unhide .
>
> Thank you very much for your time and knowledge share !
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Unhide ps74_99@yahoo.com Microsoft Excel Misc 0 24th Jul 2008 05:02 PM
Hide - Unhide =?Utf-8?B?Qm9i?= Microsoft Excel Programming 0 16th Nov 2006 05:46 PM
Hide/Unhide Help Danno Microsoft Excel Programming 3 26th Jul 2006 05:43 PM
Hide Unhide Colin Microsoft Excel Misc 4 9th Apr 2006 05:01 PM
Hide/Unhide Tom Microsoft Excel Worksheet Functions 2 12th Aug 2003 05:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 PM.