+ Reply to Thread
Results 1 to 8 of 8

A LoopToCopyColumnWithMatchingYearQuarter

  1. #1
    Registered User
    Join Date
    04-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    96

    Talking A LoopToCopyColumnWithMatchingYearQuarter

    Hi, all. I need help with following problem.
    pls open the attachment, you will see a simple sample worksheet which shows the same contents but different format seperated by column i . I need a loop could help me check the whether the year and quarter are same, if they match, then copy the whole column's value to the other side. But after copy the data, i hope it could copy the address, so that when the database change, the coped part also could change without run the macro again.
    Greatly appreciate any help! Thank you.
    Attached Files Attached Files
    Last edited by yjmmay34; 07-19-2010 at 10:06 PM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: set a special loop

    It is not clear to me what you try to achieve. It seems really too simple.
    Do you really need a macro to do this?

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: set a special loop

    Why don't you design the sheet better? You shouldn't need to copy data like that.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    04-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: set a special loop

    Hi,p24leclerc.actually i got a huge amount of data like this, i really need a macro to help me done this job, and the critical part is the copied number should be a formula or address, so that next time when i change the data, there is no need to run the macro again the copied part will also change. Thank you leclerc.

  5. #5
    Registered User
    Join Date
    04-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: set a special loop

    Hello, royUk. please check the sample again, i 've edited it. Thank you!

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: A LoopToCopyColumnWithMatchingYearQuarter

    Hi yjmmay34;

    Here's a file that doe what you want (I think) without using a macro.
    Hide Rows(1:2) and it will look like you want.
    Attached Files Attached Files
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  7. #7
    Registered User
    Join Date
    04-12-2010
    Location
    singapore
    MS-Off Ver
    Excel 2007
    Posts
    96

    Re: A LoopToCopyColumnWithMatchingYearQuarter

    hi, foxguy, thank you for your kind help. but i really need a macro to help me done this work, because i will insert this macro to my entire program. this is a macro project.

  8. #8
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: A LoopToCopyColumnWithMatchingYearQuarter

    You say
    But after copy the data, i hope it could copy the address, so that when the database change, the coped part also could change without run the macro again.
    That means that you have to copy formulas over to the other side. Or it has to run a macro to copy again.
    I provided a sheet that has the formulas already. There is no need for macros. The macros will just do what I already did.

    If this is not good enough, you will have to explain why you need it to be a macro.

    If you are saying that you can not put the formulas into you workbook, then you will need to provide your workbook so that someone can write the macro correctly. It is too hard to try and write a macro that will handle every possible situation.

+ 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