Results 1 to 10 of 10

macro to work for variable number of rows

Threaded View

  1. #1
    Registered User
    Join Date
    12-01-2006
    Posts
    49

    Exclamation macro to work for variable number of rows

    Hi guys I need some help with macros for variable data. In the attached file, the sheet named Front Page is the report I would like.

    The input page is where the data would be pasted into. I have created sample sheets named Sample 1 and Sample 2 which have the format of the data that will be uploaded.

    I would be copying and pasting the data into the input page and would like the macro to find the items from the Front Page in the Input data and paste as values only in the relevant columns.

    Example:

    The refresh button is used to clear all values in the cells. The Open P&L Input Sheet opens the relevant worksheet and clears everything in the worksheet. I would then paste the raw data into the Input page and run the macro “Feed Data”

    Basically, the Feed Data macro will do the following:

    1. Open Front Page worksheet and go to the Total Net Interest Income area
    2. Go to Input Page work sheet and find “Total Net Interest Income” and copy values in cells A41, B41 and C41 (for this sample data) and paste values only to cells B8, C8 and D8 in the Front Page worksheet.
    3. Go back to Input Page and copy values in cells F41, G41 and H41 and copy values only to cells H8, I8 and J8 in the Front Page worksheet.
    4. Repeat same process for the rest of the items.

    I tried creating the macro but the only problem is that if the number of rows is different (like the 2 samples), the macros won’t work.

    I created the macro using Sample Data 1 but if Sample data 2 is used, it comes up with errors.

    I would really appreciate if someone could help me out.

    Thanks heaps.

    Ps: Do not worry about the Grey Areas.
    Attached Files Attached Files

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