+ Reply to Thread
Results 1 to 4 of 4

Apply to Worksheets - Specific Properties in Cell Ranges

  1. #1
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Apply to Worksheets - Specific Properties in Cell Ranges

    Hi Folks,

    I am trying to apply some changes to some worksheets, I have listed it in a worksheet called "WorksheetDesign"

    The worksheet names are in column A, the cells that need to be changed are listed in column B
    Please Login or Register  to view this content.
    I have tried to make some code

    Please Login or Register  to view this content.
    Some thing is not right - I'm not sure if it's the worksheet name or some other property amiss, there are a lot of things i want to change over time , so i thought a table structure to list everything would be easier

    please do let me know
    thank you
    sl

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Apply to Worksheets - Specific Properties in Cell Ranges

    You've never assigned a string to oWksht, so it is always an empty string.
    #
    By the way, if you are going to use camel case, then the first character usually means something. o usually represents object, but you've defined oWksheet as a string. sWksht or strWksht is easier to understand. us oWB or objWorkBook if you want to indicate to someone reading your code that it is an object.

    This is all highly semantic of course and many now argue against hungarian notation altogether.
    Last edited by Neil_; 07-04-2016 at 04:41 PM.
    Frob first, tweak later

  3. #3
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Apply to Worksheets - Specific Properties in Cell Ranges

    Please Login or Register  to view this content.
    Make Worksheets(sWsheet).Font.Size equal 30 or the value in column B. You can't do both.

    option 1
    Worksheets(sWsheet).Font.Size = 30

    option 2
    Worksheets(sWsheet).Font.Size = oWsheet.Range("B" & i).Value
    Last edited by Neil_; 07-04-2016 at 04:52 PM.

  4. #4
    Registered User
    Join Date
    01-24-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    60

    Re: Apply to Worksheets - Specific Properties in Cell Ranges

    Hi Neil,

    you are right - i did not even notice the double equal, just glazed over my eyes in plain sight.

    Also i never new the o was used for object - i just thought that's how you labeled them

    I'm not having much luck fixing this let me try again
    thank you
    sl

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 04-03-2015, 05:55 PM
  2. [SOLVED] Apply Macro to specific worksheets in workbook
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-17-2014, 02:45 PM
  3. setting cell properties with a range of worksheets
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2007, 06:55 PM
  4. [SOLVED] Combining specific ranges from multiple worksheets into one
    By simora in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. [SOLVED] Combining specific ranges from multiple worksheets into one
    By simora in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  6. Combining specific ranges from multiple worksheets into one
    By simora in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. [SOLVED] Combining specific ranges from multiple worksheets into one
    By simora in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1