PC Review


Reply
Thread Tools Rate Thread

Checkbox to Hide Column G

 
 
Charlie
Guest
Posts: n/a
 
      23rd Oct 2008
Any Reason why this does not give error or a response? I built it with help
from this forum and everything seems right. Im stumped.

Im using office 2003.
______________________


Private Sub CheckBox20_Click()

If CheckBox20 = True Then
Columns("G").Hidden = True
Else
Columns("G").Hidden = False
End If

End Sub
 
Reply With Quote
 
 
 
 
Susan
Guest
Posts: n/a
 
      23rd Oct 2008
try this:

Private Sub CheckBox20_Click()

If CheckBox20 = True Then
activesheet.Columns("G").Hidden = True
Else
activesheet.Columns("G").Hidden = False
End If

End Sub


susan




On Oct 23, 1:26*pm, Charlie <Char...@discussions.microsoft.com> wrote:
> Any Reason why this does not give error or a response? I built it with help
> from this forum and everything seems right. Im stumped.
>
> Im using office 2003.
> ______________________
>
> Private Sub CheckBox20_Click()
>
> If CheckBox20 = True Then
> * * Columns("G").Hidden = True
> Else
> * * Columns("G").Hidden = False
> End If
>
> End Sub


 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      23rd Oct 2008
hi
i just plugged your code into my 2003 and it works??????
what problems are you haveing with it.

regards
FSt1

"Charlie" wrote:

> Any Reason why this does not give error or a response? I built it with help
> from this forum and everything seems right. Im stumped.
>
> Im using office 2003.
> ______________________
>
>
> Private Sub CheckBox20_Click()
>
> If CheckBox20 = True Then
> Columns("G").Hidden = True
> Else
> Columns("G").Hidden = False
> End If
>
> End Sub

 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      23rd Oct 2008
hrmm...Still does absolutely nothing when checked and unchecked.
 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      23rd Oct 2008
i have a check box with that code in it but it does absolutely nothing when i
check it or uncheck it, no error, no column hiding nothing.

-Charlie

"FSt1" wrote:

> hi
> i just plugged your code into my 2003 and it works??????
> what problems are you haveing with it.
>
> regards
> FSt1
>
> "Charlie" wrote:
>
> > Any Reason why this does not give error or a response? I built it with help
> > from this forum and everything seems right. Im stumped.
> >
> > Im using office 2003.
> > ______________________
> >
> >
> > Private Sub CheckBox20_Click()
> >
> > If CheckBox20 = True Then
> > Columns("G").Hidden = True
> > Else
> > Columns("G").Hidden = False
> > End If
> >
> > End Sub

 
Reply With Quote
 
Susan
Guest
Posts: n/a
 
      23rd Oct 2008
it worked when i tested it (excel 2000 win xp) using a control toolbox
checkbox....... i just changed the coding to checkbox1 to match my
checkbox.
maybe you are using a forms checkbox?
susan


On Oct 23, 1:58*pm, Charlie <Char...@discussions.microsoft.com> wrote:
> i have a check box with that code in it but it does absolutely nothing when i
> check it or uncheck it, no error, no column hiding nothing.
>
> -Charlie
>
>
>
> "FSt1" wrote:
> > hi
> > i just plugged your code into my 2003 and it works??????
> > what problems are you haveing with it.

>
> > regards
> > FSt1

>
> > "Charlie" wrote:

>
> > > Any Reason why this does not give error or a response? I built it with help
> > > from this forum and everything seems right. Im stumped.

>
> > > Im using office 2003.
> > > ______________________

>
> > > Private Sub CheckBox20_Click()

>
> > > If CheckBox20 = True Then
> > > * * Columns("G").Hidden = True
> > > Else
> > > * * Columns("G").Hidden = False
> > > End If

>
> > > End Sub- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      23rd Oct 2008
Aghh haah! that was it, I grabbed the wrong checkbox. boo... Thanks!

"Susan" wrote:

> it worked when i tested it (excel 2000 win xp) using a control toolbox
> checkbox....... i just changed the coding to checkbox1 to match my
> checkbox.
> maybe you are using a forms checkbox?
> susan
>
>
> On Oct 23, 1:58 pm, Charlie <Char...@discussions.microsoft.com> wrote:
> > i have a check box with that code in it but it does absolutely nothing when i
> > check it or uncheck it, no error, no column hiding nothing.
> >
> > -Charlie
> >
> >
> >
> > "FSt1" wrote:
> > > hi
> > > i just plugged your code into my 2003 and it works??????
> > > what problems are you haveing with it.

> >
> > > regards
> > > FSt1

> >
> > > "Charlie" wrote:

> >
> > > > Any Reason why this does not give error or a response? I built it with help
> > > > from this forum and everything seems right. Im stumped.

> >
> > > > Im using office 2003.
> > > > ______________________

> >
> > > > Private Sub CheckBox20_Click()

> >
> > > > If CheckBox20 = True Then
> > > > Columns("G").Hidden = True
> > > > Else
> > > > Columns("G").Hidden = False
> > > > End If

> >
> > > > End Sub- Hide quoted text -

> >
> > - Show quoted text -

>
>

 
Reply With Quote
 
redeagle
Guest
Posts: n/a
 
      23rd Oct 2008
This sounds like something that would happen to me... seemingly harmless
normal code - not working!

I would try opening a new workbook, add a checkbox, double click it and add
the code. Set a breakpoint on the event and step through the click. If that
works, then I would go through your original workbook and double check for a
naming error. When I first tried your code, I added CheckBox1 to my workbook
and clicked on it but pasted your code referencing Checkbox20 and it didn't
work until I caught the naming conflict.

John

"Charlie" wrote:

> Any Reason why this does not give error or a response? I built it with help
> from this forum and everything seems right. Im stumped.
>
> Im using office 2003.
> ______________________
>
>
> Private Sub CheckBox20_Click()
>
> If CheckBox20 = True Then
> Columns("G").Hidden = True
> Else
> Columns("G").Hidden = False
> End If
>
> 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
Re: hide a checkbox Marshall Barton Microsoft Access Reports 0 2nd Sep 2008 09:40 PM
RE: hide a checkbox NetworkTrade Microsoft Access Reports 0 2nd Sep 2008 09:29 PM
Hide & Unhide with a Checkbox =?Utf-8?B?Sm9uYXRoYW4=?= Microsoft Excel Programming 5 5th Oct 2005 12:16 PM
Checkbox to hide a picture =?Utf-8?B?UmljaA==?= Microsoft Powerpoint 4 27th Sep 2005 06:55 AM
hide rows from checkbox =?Utf-8?B?UWFzcGVj?= Microsoft Excel Programming 1 25th May 2005 10:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:08 PM.