+ Reply to Thread
Results 1 to 3 of 3

Copy, Countif, Paste Macro

  1. #1
    Registered User
    Join Date
    04-27-2010
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    2

    Copy, Countif, Paste Macro

    Hey everyone,

    To start, I'm less than a novice when it comes to programming & VBA. I'm looking for a macro that can paste a value down a certain number of rows. The number of rows to count down will be determined by the number in a given column. This value will change for certain rows. The number to be pasted will also change for certain rows. Below is a sample of the data. Attached is a sample of the data.

    Property, Count, TotalSF, $PSFAdj
    7, 8, 132410, 239.78
    8, 0, 0,
    9, 0, 0,
    10, 0, 0,
    11, 0, 0,
    12, 0, 0,
    13, 0, 0,
    14, 0, 0,

    For example, I'm looking for a macro that can paste the "$PSFAdj" value, 239.78, down according to the number in the "Count" column, 8 rows. There are roughly +860K rows. Both the $PSFAdj and Count numbers will change occasionally throughout the data set so a static reference to the cell or number doesn't work.

    Thanks in advance. I appreciate all your help and time. Have a great one.
    Attached Files Attached Files
    Last edited by Alexc1620; 04-27-2010 at 05:28 PM.

  2. #2
    Registered User
    Join Date
    04-23-2010
    Location
    Albuquerque, USA
    MS-Off Ver
    Excel 2007
    Posts
    21

    Smile Re: Copy, Countif, Paste Macro

    from looking at your form looks like all you are asking for is auto filtering on column J. Here is the code to do that but it is a build in to excel. If you are using office 2007 you can find it under the data tab.
    Please Login or Register  to view this content.
    Last edited by mdnghtsnpr; 04-27-2010 at 05:45 PM. Reason: TYPO

  3. #3
    Registered User
    Join Date
    04-27-2010
    Location
    Miami, Florida
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Copy, Countif, Paste Macro

    Hey mdnghtsnpr,

    Thanks for the quick response. I think I may be missing something from your response. The data is already sorted to the extent necessary. I'm looking for a macro / formula that can paste whatever non-blank entry in the "$PSFAdj" column down a certain number rows. The number of rows to be pasted down is determined by the "Count" column. Only catch is the number in the "Count" column will change occasionally. In my example above I used 8 rows but sometimes its 2 and sometimes its 140, all within the same data set, based on the number of related entries. I hope this helps clarify the question. Let me know if the sorting you've proposed above can do this and if I'm missing something from the code. Thanks again for the response. Have a great one.

+ 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