+ Reply to Thread
Results 1 to 7 of 7

Problem with loop

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Problem with loop

    Hi
    I have played arounf with this code to try and create aloop
    The part I have highlighted in red is where I think I'm going wrong. No error is showing but nothing is happening either

    Would anybody have any suggestions on how sort it

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Problem with loop

    You are saying A5 down in that case x should be 5
    Please Login or Register  to view this content.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Problem with loop

    Hi,

    There was no highlighted text. Are you able to upload the workbook and describe in a narrative form the task you are wanting to achieve?

    I suspect the problem is that the Cover Page is not active when the macro is run.
    Try separating the Workbook.Activate and Sheets("Cover Page").Activate instruction into two independent instructions.
    Last edited by Richard Buttrey; 03-21-2014 at 05:03 AM.

  4. #4
    Registered User
    Join Date
    07-17-2012
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problem with loop

    Thanks for your help

    But it seems now that im getting a runtime error on the text highlighted below. I suspect I have denfined Icell2properly

    I will try and put up a work sheet with the data but the data sensitive so I will have to create a worksheet with dummy data.

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Problem with loop

    Try this instead:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-17-2012
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problem with loop

    Im Still getting a runtime error

    It might the way im using Icell2

    Also I dont think have ICELL2 denfined right(highlighted below )

    Icell2 is being used as worksheet name in two locations as highlighted below

    The two workbooks have the same worksheets names in them,

    I will have time later and i will put up the worksheets im working with and you might have a betyter understanding of what im trying to do



    Please Login or Register  to view this content.
    Last edited by bobfoley91; 03-21-2014 at 07:06 AM.

  7. #7
    Registered User
    Join Date
    07-17-2012
    Location
    ireland
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Problem with loop

    Hi

    I have been able to create a workbook with randon data in it
    • The acutall output file from the data base has 26 different tabs in it, for the example i only have two int it
    • The matmacro test.xlsm file is example of a file use to analysis certain tabs from the output file.
    • The idea behind the loop is that the data in database is changing on a weekly basis and the there is a new export file every couple of days and i must ciopy paste fresh data in every time
    • The loop in the macro is to read which tabs are on the "coverpage" i want to update from the output file. Im still having trouble with loop

    Please Login or Register  to view this content.
    Thanks for help
    Attached Files Attached Files

+ 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. Vlookup problem in a loop with cell property and variable cell problem (long title sry)
    By ExcelsiorLux in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2013, 10:38 AM
  2. [SOLVED] Loop inside a loop problem!
    By questionguy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2012, 12:54 PM
  3. [SOLVED] Loop problem
    By Shawn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2005, 07:05 PM
  4. [SOLVED] Loop Problem
    By Cody in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2005, 04:05 PM
  5. [SOLVED] Problem adding charts using Do-Loop Until loop
    By Chris Bromley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2005, 09:06 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