I currently have a sheet that I need to format many columns. The columns are not always next to each other. Is it possible to accomplish without adding the style one column at a time? I was thinking of something like CreateRange("L:L,P:P,R:R,AA:AA") to create this range then I would apply the style for these four columns. Also I noticed a RangeCollection class, do I need to use that? I looked at the examples but I could not find a way to utilize the RangeCollection class to get this done.
I think you may try to use NameCollection and create Name object to specify your desired ranges for your requirements. I have written a sample code for your reference, please refer to it and accomplish your tasks accordingly:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.