+ Reply to Thread
Results 1 to 3 of 3

Help me find whats wrong with my code?

  1. #1
    Registered User
    Join Date
    02-02-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    42

    Help me find whats wrong with my code?

    Hello,

    I have a small function with which I am copying worksheets it looks as follows:
    Please Login or Register  to view this content.
    Now as you can see the CopyWorksheet function is called a few times. But for whatever reason this doesnt work. If I remove the "NAAMSNAME" and "NAAMSSHEET" and replace them with text than it will work.

    Oh and if it needs to be said, this is supposed to take the caption of a OptionButton, search the workbook for hseets that match the caption text and if there is one do nothing if there isnt. It is supposed to copy a designated sheet and rename it to the Option Button Caption.

    Any ideas?

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Help me find whats wrong with my code?

    Try debugging with msgboxes:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-02-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Help me find whats wrong with my code?

    Thankyou for the tip, I found with that the the value wasnt being transferred properly. I put the Global Variables inside their own Module and now it works perfectly

+ 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. whats wrong with my code
    By comp23 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2012, 04:59 AM
  2. Whats wrong with my code
    By dougieg in forum Excel General
    Replies: 9
    Last Post: 06-28-2012, 12:12 PM
  3. Whats wrong with this code??
    By tlinton in forum Access Tables & Databases
    Replies: 5
    Last Post: 01-13-2012, 07:14 PM
  4. Whats Wrong With My Code Please?
    By GogsJames in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-10-2006, 11:27 AM
  5. Whats wrong with this code??
    By marksince1984 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2006, 08:18 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