+ Reply to Thread
Results 1 to 12 of 12

In need of some help modifying a function (already written)

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    In need of some help modifying a function (already written)

    Hey,

    I'm looking for some help editing this macro, it's fairly hard to explain but should be fairly easy to change/fix I hope.

    Basically, I need the macro instead of copying from first row(s) it finds for it to copy from 3 rows down from the first row it finds (offset of 3) but when it's retreiving the data back it needs to put it back in it's original place so it needs to detect the fact it's left 3 rows of data out when it copies...

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Anyone able to help?


  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: In need of some help modifying a function (already written)

    Which of the 2 functions is it that needs changed?

    Have you tried using Offset?
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Hey,

    I've tried to use offsets but can't figure out why it wont work.

    See the example attached for example data and an example macro, I've included a text box with some more instructions.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Hey,

    Anyone able to assist me further?

    I'd much appreciate the help.

  6. #6
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Bump, anyone able to assist?

    Thanks
    - Hyflex

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: In need of some help modifying a function (already written)

    I'm sorry but it really isn't clear what you want to do.

    You could alter the code that finds the ranges to copy so that it only includes the data and not the headers, see below, but I don't understand the retrieving data part.
    Please Login or Register  to view this content.
    By the way, why do you want to copy the data, run some code on what's been copied and then transfer back?

    Isn't it possible to work on the data in situ?

  8. #8
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Hey Norie,

    It's quite hard to explain but for the copy part you've understood it perfectly, to only copy the data and not the headers, for the retrieving part I can now see a problem moving it back... there is no identifying header to copy it back...

    You're correct it is possible to work on the data in situ, but the amount of changes I make and differences between the lists make it extremely difficult to work on.

    For the retreive part, usually it would use the headers but as there aren't would you be able to help by modifying that code to check using the first person and second persons name and if both match then copy it back in leaving the headers in tact

    So the only thing being moved around is the data, I understand this is a rather unusual request as it seems somewhat pointless, If I was able to show you my actual document you'd understand but it's too big for the forum and has some confidential information in it.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: In need of some help modifying a function (already written)

    Identifying where to return the data is a big problem especially when you are copying a whole bunch of non-contiguous data.

    Is it possible to work with one 'block' of data at a time?

    For example take the data for 'test1' from rows 19-24, work on that and then return it to that range.

    You should be able to identify where to return the data to using rngFound.

    Is there no way you could mock up something with representative data?

    PS Is there a reason you can't copy the headers?

  10. #10
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Hey,

    Thanks for replying, unfortunately it's not possible to work on one dataset at a time.

    I've tried to start modifying the retreive data part but the first macro what you edited isn't actually working right, the first bit of data which is 9 rows, but only 6 rows of data is being turned into 9 rows of data

    Please Login or Register  to view this content.
    I'm attempting to match the first person's name (I'll have to add another check for the second persons name aswell just to make sure.

    The reason I can't copy headers is because of all my conditional formatting and it's also easier formula wise.

    The data respresented is as close as I can give, it follows pretty much the same structure as my own sheets excluding formula's

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: In need of some help modifying a function (already written)

    I changed the COPYDATA code to only copy the 6 rows of data, which is what you wanted isn't it?

    That's all I changed.

    Not sure what you mean about conditional formatting preventing the inclusion of the headers.

    What conditional fomatting are you referrring to?

    What exactly are you doing with the data anyway?

  12. #12
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: In need of some help modifying a function (already written)

    Hey Norie,

    Yes that is what I wanted but it didn't seem to work correctly the 9 rows for the first race is not coming out as 6 rows (-3 for the headers to be removed), but it's coming out as 9...

    In regards to the conditional formatting, we have a LOT of conditional formatting which plays havoc with the headers, it's an excel 2003 compatibility issue, this is the only way around it without having to re-write a lot of stuff.

    The data gets changed and edited then I want it to go back to it's original places.


    I could potentially do it a different way.
    1) Use my old functions to edit the data
    2) Use a new function what copies each dataset (only the data) into the sheet's like you did, then instantly copying it back. They will still have to be put into the new sheet one by one, but can be copied back as soon as they go into the sheet

    Does that make sense?

+ 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