Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Is there anyway to make this code shoter and run faster because it takes abit of time to run. Sub Main() Dim Rng As Range For Each Rng In Range("G3:G201,G203:G401,G403:G601,G603:G801,G803: G1001,G1003:G1201,G1203:G1401,G1403:G1601,G1603:G1 801,G1803:G2001,G2003:G2201,G2203:G2401") Rng(1, 1).EntireRow.Hidden = (Rng.Value = "") Next Rng End Sub Thanks -- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
Dim x as Long For x = 3 to 2203 step 200 Range(Rows(x),Rows(x + 198)).EntireRow.Hidden = True Next adjust as needed -- sb "Stu" wrote in message ... Hello, Is there anyway to make this code shoter and run faster because it takes abit of time to run. Sub Main() Dim Rng As Range For Each Rng In Range("G3:G201,G203:G401,G403:G601,G603:G801,G803: G1001,G1003:G1201,G1203:G1 401,G1403:G1601,G1603:G1801,G1803:G2001,G2003:G220 1,G2203:G2401") Rng(1, 1).EntireRow.Hidden = (Rng.Value = "") Next Rng End Sub Thanks -- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To be honest with you Im not sure on how to adjust as needed so im still
a little confused. --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Stu,
In your original you have (Rng.Value = "") I'm not sure of what you meant by that so I just had the code hide all rows. Let me know... If there is some sort of criteria than you'll need to have my code in an If...then statement. Dim x as Long For x = 3 to 2203 step 200 If *something* then Range(Rows(x),Rows(x + 198)).EntireRow.Hidden = True End If Next -- sb "Stu" wrote in message ... To be honest with you Im not sure on how to adjust as needed so im still a little confused. --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want the row to be hidden if lets say G13 has nothing in it and i want
the row to be visible if G13 has something in it. --- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
one way:
On Error Resume Next 'in case no blanks Range("G3:G201,G203:G401,G403:G601," & _ "G603:G801,G803:G1001,G1003:G1201," & _ "G1203:G1401,G1403:G1601,G1603:G1801," & _ "G1803:G2001,G2003:G2201,G2203:G2401").SpecialCell s( _ xlCellTypeBlanks).EntireRow.Hidden = True On Error GoTo 0 In article , Stu wrote: Hello, Is there anyway to make this code shoter and run faster because it takes abit of time to run. Sub Main() Dim Rng As Range For Each Rng In Range("G3:G201,G203:G401,G403:G601,G603:G801,G803: G1001,G1003:G1201,G1203:G140 1,G1403:G1601,G1603:G1801,G1803:G2001,G2003:G2201, G2203:G2401") Rng(1, 1).EntireRow.Hidden = (Rng.Value = "") Next Rng End Sub Thanks -- Stu ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shorter way | Excel Discussion (Misc queries) | |||
2nd attempt ~ Faster/Shorter formula | Excel Worksheet Functions | |||
Need faster/shorter formula | Excel Worksheet Functions | |||
Can faster CPU+larger/faster RAM significantly speed up recalulati | Excel Discussion (Misc queries) | |||
shorter way? | Excel Programming |