PC Review


Reply
Thread Tools Rate Thread

BeforeDoubleClick processing question(s)

 
 
=?Utf-8?B?UmU6IEZvcm1zIC8gU2VuZCB0byAuLi4uLlZCQSBv
Guest
Posts: n/a
 
      7th Nov 2006
I am new to vba and excel and would like to use a double click to hide or
unhide rows if the color is white. Question: once I get it working (see
below) will the hidden rows automatically be excluded from further
processing? I believe the vba for this is correctly sitting in the excel
objects area for the active sheet.

The syntax of most things in vba still baffle me. D1 is the click-to-hide
cell. D2 is to unhide.

Dim cell As Range

Private Hiderows()
SheetName_Beforedoubleclick (D1)
For Each cell In Range("S5:S300")
cell.EntireRow.Hidden = cell.Interior.ColorValue = xlNone
Next cell
End Sub

Private Showrows()
SheetName_Beforedoubleclick (D2)
cell.EntireRow.Hidden = False
End Sub
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      7th Nov 2006

You may find this to be a bit easier. If hidden, will unhide. If not, will
hide

Sub togglehide()
Rows("2:10").Hidden = Not Rows("2:10").Hidden
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Re: Forms / Send to .....VBA or Macro?"
<(E-Mail Removed)> wrote in message
news:E3625BA2-3CBC-4E9B-ADB0-(E-Mail Removed)...
>I am new to vba and excel and would like to use a double click to hide or
> unhide rows if the color is white. Question: once I get it working (see
> below) will the hidden rows automatically be excluded from further
> processing? I believe the vba for this is correctly sitting in the excel
> objects area for the active sheet.
>
> The syntax of most things in vba still baffle me. D1 is the click-to-hide
> cell. D2 is to unhide.
>
> Dim cell As Range
>
> Private Hiderows()
> SheetName_Beforedoubleclick (D1)
> For Each cell In Range("S5:S300")
> cell.EntireRow.Hidden = cell.Interior.ColorValue = xlNone
> Next cell
> End Sub
>
> Private Showrows()
> SheetName_Beforedoubleclick (D2)
> cell.EntireRow.Hidden = False
> End Sub



 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      8th Nov 2006
The D1 code looks a little flawed, like maybe you ran something together.
Maybe it should be:

Private Sub Worksheet_Beforedoubleclick (D1)
For Each cell In Range("S5:S300")
cell.Interior.ColorIndex = xlNone
cell.EntireRow.Hidden = True
Next cell
End Sub

I haven't tried this but, I thought it might point you in the right
direction. Check out the hidden property in VBA Help. Also see the
BeforeDoubleClick method in VBA Help. You can access VBA Help by pressing
Alt+F11 to open the VB Editor. Good luck.



"Re: Forms / Send to .....VBA or Macro?" wrote:

> I am new to vba and excel and would like to use a double click to hide or
> unhide rows if the color is white. Question: once I get it working (see
> below) will the hidden rows automatically be excluded from further
> processing? I believe the vba for this is correctly sitting in the excel
> objects area for the active sheet.
>
> The syntax of most things in vba still baffle me. D1 is the click-to-hide
> cell. D2 is to unhide.
>
> Dim cell As Range
>
> Private Hiderows()
> SheetName_Beforedoubleclick (D1)
> For Each cell In Range("S5:S300")
> cell.EntireRow.Hidden = cell.Interior.ColorValue = xlNone
> Next cell
> End Sub
>
> Private Showrows()
> SheetName_Beforedoubleclick (D2)
> cell.EntireRow.Hidden = False
> End Sub

 
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
BeforeDoubleClick code Ronbo Microsoft Excel Programming 3 27th Jan 2010 11:35 PM
Referring to BeforeDoubleClick art Microsoft Excel Programming 6 13th Oct 2008 03:46 AM
Help With BeforeDoubleClick jean Microsoft Excel Programming 3 19th Mar 2008 07:02 PM
BeforeDoubleClick Stefi Microsoft Excel Programming 7 20th Dec 2007 10:13 AM
beforedoubleclick and selectionchange =?Utf-8?B?Y2xhcmE=?= Microsoft Excel Programming 0 24th Apr 2007 06:52 PM


Features
 

Advertising
 

Newsgroups
 


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