+ Reply to Thread
Results 1 to 3 of 3

Incrementing Index for paste function with each use of a macro

  1. #1
    Registered User
    Join Date
    07-13-2012
    Location
    Virginia, United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Incrementing Index for paste function with each use of a macro

    Right now, I'm trying to use excel data of luminance across several ovoid pixels to obtain their width and heights at a subpixel level. I've got a setup in which I need to do the following for a massive quantity of data, where automated steps are currently in bold:

    -Find all local mins and maxes in a slightly noisy normalized sine wave
    -Combine mins and maxes to get midpoints
    -Find two cells betwen the indexes of the current min and max which contain the midpoint between them
    -copy that data, paste it into a simple formula which spits out the rounded value for where the midpoint would be at a sub-cell level, ie .42 cells after the 24th cell
    -add that to the index of the cell where I got the first value (ie adds .42 to 24)
    -copy that into a simple calc which subtracts the right cells from each other to get widths and heights and dumps them into another spreadsheet

    The problem right now is that I'd really like to automate the process of copying the 24.42 value into a cell, but I need it to not overwrite the value before it. Is there a simple way to increment the index that it pastes to a lower cell each time it runs? My experience with excel and formulas is very high but my experience with macros is in its infancy, so bear that in mind. Thanks in advance

  2. #2
    Registered User
    Join Date
    07-13-2012
    Location
    Virginia, United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Incrementing Index for paste function with each use of a macro

    For the curious, here's the code I have right now, which copies the selected cells (ie 24 and 25) then pastes their values into the subpixel calc (which gets the subpixel distance, truncates it to two decimal places, adds it to the value of the top cell copied, 24, and spits out the 24.42) then pastes the final 24.42 value into the designated spot, which is the one I want to increment each time

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-13-2012
    Location
    Virginia, United States
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Incrementing Index for paste function with each use of a macro

    New problem: I think this code will do everything I want it to, but I can't make it compile; I'm getting an error 35, which seems like it's probably pretty common and easy to solve, I'm just dumb. What am I doing wrong here?

    Please Login or Register  to view this content.

+ 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