+ Reply to Thread
Results 1 to 2 of 2

Needing a couple of lines of code...

  1. #1
    Registered User
    Join Date
    01-17-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003, 2007, & 2010 Beta
    Posts
    78

    Needing a couple of lines of code...

    Hi,
    Hope someone can help me here.
    I want to say, in vba, that if a certain cell, with range name 'Highlight', whose permitted values are from 1 to 9, happens to = 9, then change its value to 1, otherwise add 1 to its value. Nothing more. I'm not writing the code properly, so I get a Compile Error message "End If without block if". Could someone write me out the correct couple of lines of code, please? There'll be a macro button which, when clicked, will run that code, either raising the value of 'Highlight' by 1, or reducing it from 9 to 1. Many thanks,
    Lotusman

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Needing a couple of lines of code...

    Hi Lotusman

    This is easily enough done but your thread title breaks a forum rule so will have to be changed to something more descriptive of the problem before we can help. Sorry.

    Beth

+ 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. What I though would be a very straightforward couple of lines of code....
    By Hastie73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2018, 12:03 PM
  2. Replies: 6
    Last Post: 01-17-2017, 11:44 AM
  3. Needing a code to be able to do running totals for multiple cells.
    By waxsiwalas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2016, 10:06 AM
  4. [SOLVED] Represent (define?) a section of code with a variable (shorten long code lines)?
    By Gene@action in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2016, 03:59 PM
  5. Replies: 7
    Last Post: 07-01-2015, 10:55 PM
  6. [SOLVED] i have this code to create a new workbook but id like to change a couple things
    By Jenkins27 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-14-2015, 01:40 PM
  7. Use VBA (excel) to extract only Bold text from excel template. Needing a macro code!!
    By Macgyver123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2012, 09:57 AM

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