Author Topic: Excel problem  (Read 648 times)

0 Members and 1 Guest are viewing this topic.

w4tc

  • Achiever
  • Shrub
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 170
Excel problem
« on: December 31, 2010, 11:47:55 AM »
Hello buddy's

xD at this moment i a little stock on excel
i have a checkbox that called "Wedstrijdgroep" ( sorry dutch name  in english is it : "Matchgroup" )

i wanne make a group a cell ( B24 : B28 )
there ar numbers in it ect
but if my checkbox Matchgroup is not checked
must it be hidden so i use ;;;
and is it checked it must be visible
so i tried it in a macro, but somereason it dont works  :-\
can somebody help me?

here is the code :

Code: [Select]
Sub macro1()
'
'
If Wedstrijdgroep = True Then
    Range("B24:B28").Select
    Selection.NumberFormat = "General"
    Else: Range("B24:B28").Select
    Selection.NumberFormat = ";;;"
End If
End Sub

thx for the help!
Frederik
W4tc
« Last Edit: December 31, 2010, 11:52:04 AM by w4tc »

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Excel problem
« Reply #1 on: December 31, 2010, 12:00:18 PM »
This is in VBA, yes?

Which version of Excel are you using?

w4tc

  • Achiever
  • Shrub
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 170
Re: Excel problem
« Reply #2 on: December 31, 2010, 12:14:57 PM »
Yes, i use office 2007
but normale to use vba ect. the version is not not always important.
I think that for this not realy important is?

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: Excel problem
« Reply #3 on: December 31, 2010, 12:53:02 PM »
Code: [Select]
Sub macro1()
If Wedstrijdgroep.Checked = True Then
Range("B24:B28").Select
Selection.NumberFormat = "General"
    Else
Range("B24:B28").Select
Selection.NumberFormat = ";;;"
End If
End Sub


Try that. I don't know much VBA, but I'm passable-ish in VB.NET