+ Reply to Thread
Results 1 to 2 of 2

Formating cells with a Loop

  1. #1
    Registered User
    Join Date
    01-27-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    4

    Formating cells with a Loop

    Hi,
    I've created a macro that checks various cells in 2 columns in one sheet and then formats 2 columns in another. However the rows do not correspond ie row 2 in sheet 2 might correspond to row 2 in sheet1 but row 3 in sheet 2 will correspond to row 4 in sheet1 (due to the cell formatting and page layout in sheet 1.
    I need this macro to run on 40 rows max and the obvious thing would be a loop. But I can't think on how to do this.
    So is the answer to repeat the code 40 times? And if so, am I better putting the code into seperate modules to keep it tidy with one module leading on to another?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Formating cells with a Loop

    Hi,

    If you post a sample workbook it would help us to see if there's a pattern that came be used in the loop or another way of dealing with it.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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