+ Reply to Thread
Results 1 to 3 of 3

Problems with offset function in VB

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    London
    Posts
    6

    Problems with offset function in VB

    Hello,

    I have written the following piece of code

    Please Login or Register  to view this content.
    Basically I have a chart that is linked into a drop down box list select. When you change the selection in the drop down box, the axis of the chart changes. I am trying to write a macro where you select a range of chart serries you want, click a button and then this will do the drop down boxes automatically, copy each chart, and then paste into another workbook.

    Problem I am having is the
    Please Login or Register  to view this content.
    It works the first time through the loop but then the second time it gives me a '424' error. All I'm trying to do is make current_cell1 and 2 equal the next cell down in the column, and so on until it hits 9999.

    Any thoughts on why it doesn't work would be much appreciated.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430
    Because you need not declare your variables the following simply writes the contents of the range into the variable rather than update the reference

    Please Login or Register  to view this content.
    Instead you need to use
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-18-2008
    Location
    London
    Posts
    6
    Excellent, many thanks

+ 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. Excel 2007 error when adding custom help file to user defined function
    By sabotuer99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2009, 01:10 AM
  2. Offset function
    By Sir08 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-26-2008, 01:12 PM
  3. OFFSET function
    By jhelliar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2007, 10:45 AM
  4. Offset and count function
    By Strummer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2007, 02:24 AM
  5. Function problems, please help
    By mamagoochie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-13-2006, 10:20 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