• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro for TRUE/FALSE Range Value

Khalid NGO

Excel Ninja
Hello Everyone,
Greetings...

I am working on a sheet where i get TRUE / FALSE for all checkboxes.
64 Check boxes placed (Range = O6:O69)

Currently i m using this:

Code:
Sub Button66_Click()

Range("O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17,O18,O19,O20,O21,O22,O23,O24,O25,O26,O27,O28,O29,O30,O31,O32,O32,O33,O34,O35,O36,O37,O38,O39,O40,O41,O42,O43,O44,O45,O46,O47,O48,O49,O50,O51,O52,O53,O54,O55,O56,O57,O58,O59,O60,O61,O62,O63,O64,O65,O66,O67,O68,O69").Value = False

End Sub

Code:
Sub Button67_Click()
Range("O6,O7,O8,O9,O10,O11,O12,O13,O14,O15,O16,O17,O18,O19,O20,O21,O22,O23,O24,O25,O26,O27,O28,O29,O30,O31,O32,O32,O33,O34,O35,O36,O37,O38,O39,O40,O41,O42,O43,O44,O45,O46,O47,O48,O49,O50,O51,O52,O53,O54,O55,O56,O57,O58,O59,O60,O61,O62,O63,O64,O65,O66,O67,O68,O69").Value = True
End Sub

Manually typing each of the range number is not a good way (which i m using)
I need to know the some other methods to shorten / simplify the code.

Thanking you in anticipation.

Khalid
 
Thankfully, it's one continuous range, so we can just call out the whole range in one short bit.
Code:
Range("O6:O69").Value = True
 
Back
Top