+ Reply to Thread
Results 1 to 10 of 10

Use Macros to copy and paste transpose through a range of data

  1. #1
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Use Macros to copy and paste transpose through a range of data

    Need help pls.

    Pls see attached. I got data in column A. (yellow in colour)
    Need to copy each running 8 rows and paste them onto Column E to L.

    As I got thousands of records in column A, its very tedious to do copy and transpose paste one by one.
    Can advise how to use macro on this?
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Use Macros to copy and paste transpose through a range of data

    Hi zxchan,
    try it
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Use Macros to copy and paste transpose through a range of data

    Try the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-10-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Use Macros to copy and paste transpose through a range of data

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Use Macros to copy and paste transpose through a range of data

    Ankit,
    Are you sure the code you posted is meant to be for this thread?
    The OP has asked to transpose a single sheet, in a single column in to rows. Why do you need to loop through sheets?

  6. #6
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Use Macros to copy and paste transpose through a range of data

    Many thanks! It helps.

    But raninto another problem. Realised that not all records are in sets of 8.

    1st field is doctor's name, 2nd field is clinic address, 3rd to 5th field is address, 6th field is a hyperlink, 7th field is doctor's specialty, 8th field is telephone number,

    The problem is that sometimes the addres is quite short and only takes up field 3 and 4 and field, and 5th field becomes hyperlink, 6th field becomes speciality, 7th field becomes telephone number.

    Any way for the macro to recognise that hyperlink will only take up the 6th field and 5th field is to be left blank if the address only takes up 3rd and 4th field.


    Pls see attached for the data. Thanks again for the help.
    Attached Files Attached Files

  7. #7
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Use Macros to copy and paste transpose through a range of data

    maybe so
    Please Login or Register  to view this content.
    Note: there are no hyperlinks in cells A13 and A21 in your example

  8. #8
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Use Macros to copy and paste transpose through a range of data

    Thanks Nilem!

    It works well, but I realised that the 1st field - doctor's name is also a hyperlink.. and the macro runs into problem.

    Need your help again pls. Instead of getting the macro to recognise the hyperlink, how to get the macro to recognise a string of words "View more info".
    The words "View more info" will only take up the 6th field and 5th field is to be left blank if the address only takes up 3rd and 4th field

    Thanks again

  9. #9
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Use Macros to copy and paste transpose through a range of data

    try
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Use Macros to copy and paste transpose through a range of data

    Thanks Nilem, you are awesome.

    One last thing pls.

    Possible for the "view more details" be a hyperlink as well? Currently its transposed into a text
    Currently, if the address field is short, it will take up field no.3 and 4. Is it possible for short address to take up field no. 3 and field no.5 and field no.4 will be left blank?

    Thanks, appreciate very much

+ 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