+ Reply to Thread
Results 1 to 14 of 14

Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    Hi there,
    I am trying to copy and mid(Ax,1,3) cells from sheet1, column A1:A10000 to sheet2, column A1:A10000.

    I would also like to do this for mid(Ax,6,11) for sheet2(B1:B10000)

    P.S. I say sheet1,A1:A10000 but if possible it could also just go to the end of sheet or until Ax = ""

    Many thanks!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    It will be good if you explain with the help of a sample file.

    To Attach a File:

    1. Click on Go Advanced.
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    In the attached example I have done exactly what I wanted but using the standard excel formula.
    I would like to have the same result but using a macro.

    Thanks again and please let me know if any further explanation is needed.
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    You have done text to columns to separate this B01 010297 into 2 separate columns. What about 010911?

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    that wont be needed in sheet2 so only need exactly whats in sheet2 in the example

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    There are about 5 spaces in column B in sheet2. Are those required?

  7. #7
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    no i dont need the spaces.. sorry

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    Why do you want to do it via a macro? Why not do it manually? You just have to drag the formula down.

  9. #9
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    the sheets are a lot more complex than the example and the macro would just fit in as a small part of the over all macro.

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    All you need is this bit of code -

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    you my friend are to clever! thanks!

  12. #12
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    Am glad it worked for you.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  13. #13
    Registered User
    Join Date
    07-16-2012
    Location
    JHB, RSA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    okay ive done that, i have another question could i possibly email you about it?

  14. #14
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy and mid cells from one sheet to another in Excel 2010 using macro(VBA)

    Why dont you create a new thread?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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