[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Unhide/Hide a column set together Excel

Posted on 2012-04-03
8
Medium Priority
?
381 Views
Last Modified: 2012-04-03
Hello All,

I am trying to unhide/ hide a set of columns - unhide / hide with an ActiveX checkbox in excel 2007.

Private Sub Info1_Click()
If Info1 = True Then

    Columns("D1:G1").Select
    Selection.EntireColumn.Hidden = False
   
    Else:
    Columns("D1:G1").Select
    Selection.EntireColumn.Hidden = True

End If

End Sub

But this code is giving me errors, any ideas? I have attached the excel file.

Thank you
R
Nextbutton-r12.xlsm
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 15

Expert Comment

by:gplana
ID: 37802434
Hi. Which errors are you getting ? I think this could help to solve the problem.

Thanks.
0
 

Author Comment

by:Rayne
ID: 37802515
Hello

I get this Run-time Error 1004.

Debugging highlights this line;

Columns("D1:G1").Select
0
 

Author Comment

by:Rayne
ID: 37803382
Any guess??
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 14

Accepted Solution

by:
Tommy Kinard earned 2000 total points
ID: 37803459
I got this to work

Private Sub Info1_Click()
    If Info1 = True Then
        Columns("D:G").EntireColumn.Hidden = False
    Else
        Columns("D:G").EntireColumn.Hidden = True
    End If
End Sub
0
 

Author Comment

by:Rayne
ID: 37803475
Thanks Dragon, mush appreciated
0
 

Author Comment

by:Rayne
ID: 37803476
i meant much ;)
0
 
LVL 14

Expert Comment

by:Tommy Kinard
ID: 37803491
LOL no reason to be mushy :)

Thanks for the points and the grade!
0
 

Author Comment

by:Rayne
ID: 37803590
no problem :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question