+ Reply to Thread
Results 1 to 4 of 4

Adding constant values using object variable coding

  1. #1
    Forum Contributor
    Join Date
    04-13-2011
    Location
    Havant, Hants, England
    MS-Off Ver
    Excel 2010
    Posts
    116

    Adding constant values using object variable coding

    Hi, I'm tying to add some values to a worksheet - some are picked off another worksheet and some are constants e.g. G The code below goes into error when trying to add the constants. Can you tell me what is the correct syntax to use to be able to add these constant values? thanks, Neil

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Adding constant values using object variable coding

    I'm just curious: in lines with errors shouldn't be WSD1 instead of WDS1?

  3. #3
    Forum Contributor
    Join Date
    04-13-2011
    Location
    Havant, Hants, England
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Adding constant values using object variable coding

    You're right - clearly getting tired and need to stop! thanks, Neil

  4. #4
    Forum Contributor
    Join Date
    01-03-2013
    Location
    Aberdeen, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    163

    Re: Adding constant values using object variable coding

    What I can recommend to you is to go to VBA editor, click Tools -> Options and in Editor tab tick Require Variable Declaration. This should prevent you from using undeclared variables (note after that operation an Option Explicit code line will be added every time you make new macro).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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