+ Reply to Thread
Results 1 to 8 of 8

Copy cell from on sheet to another If the cells starts with **

  1. #1
    Registered User
    Join Date
    10-18-2014
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    30

    Copy cell from on sheet to another If the cells starts with **

    Hello and thank you for your help in advance any input is greatly appreciated.

    Basically (or not so in my case) I was wondering if it possible to create a Macro that would Copy and Paste Data from one sheet to another in the same Workbook if the the cell starts with AA,BB,CC or DD and Put that "Data" in its already named sheet. The beginning of each cell can change so some times the data my be AB or CE or DE depending on the situation but the data will only be in four different iterations i.e. CD EG GH HH and so on. (Ican chge this in the macro)

    Example of the data I have

    From a sheet named "Data" (All Data is in Column A and starts from Row 1 and can be unto 10,000 Rows in length)

    BB01465178
    AA11111547
    AA13579456
    BB45765135
    CC45612347
    DD46785947
    DD13546878
    CC17846597

    Result

    Sheet "Data AA"

    AA11111547
    AA13579456

    Sheet "Data BB"

    BB01465178
    BB45765135

    Sheet "Data CC"

    CC17846597
    CC45612347

    Sheet "Data DD"

    DD13546878
    DD46785947

    This Macro would ideally search though all of Columns A and find all the Cells starting with AA from sheet "Data" and copy them into a sheet named "AA Data" into Column A then copy all the Cells that start with BB from sheet "Data" and copy them into the sheet "BB Data" into Column A and so on till all four sheets have been done.

    In regards to how the macro does this it really does not matter i.e. if it deletes the data or leaves it or even if the macro only works with one set of data and I have to run the macro 4 separate times it does not matter all long as the outcome is the same.

    Again I really appreciate any input into this matter and thank you for your help.
    Last edited by John Swift; 12-06-2014 at 05:07 AM. Reason: Extra Data

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Copy cell from on sheet to another If the cells starts with **

    Hi John,

    You may have to tweak my following code as at one point you say to distribute the data to sheet "Data AA" and then you say to send it to sheet "AA Data" - my code is based on the former:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    10-18-2014
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy cell from on sheet to another If the cells starts with **

    Thank you for your help

    I should add that I cant code in VBA well and your macro I have no idea what to do with it.

    But I still do appreciate the help.

    Thank you.

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Copy cell from on sheet to another If the cells starts with **

    Try this macro

    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Copy cell from on sheet to another If the cells starts with **

    To insert the macro into the relevant workbook follow these four steps:

    1. Copy my macro to the clipboard (Ctrl + C [note this notation means to press and hold the first key followed by the second key])
    2. In the workbook where you want the macro press Alt + F11
    3. Paste (Ctrl + V) in my macro from the clipboard (step 1 above) into the module
    4. From the File menu select Close and Return to Microsoft Excel

    To use the macro just follow this step:

    Press Alt + F8 and from the Macro dialog click on MoveData and then click on the Run button

    HTH

    Robert

  6. #6
    Registered User
    Join Date
    10-18-2014
    Location
    Ontario, Canada
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy cell from on sheet to another If the cells starts with **

    Thank you for you help guys it works perfectally

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Copy cell from on sheet to another If the cells starts with **

    You're welcome and thanks for marking the thread as solved (and the rep)

  8. #8
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Copy cell from on sheet to another If the cells starts with **

    No problem

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Copy from one sheet and paste two cells to the right from active cell on another sheet
    By pasqualebaldi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-10-2013, 01:16 PM
  2. Copy certain cells in row to new sheet if there is a yes in that row cell x
    By SEJ50 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2013, 02:32 PM
  3. Average formula that starts at first cell>0 and calculates blank cells as 0?
    By bradtredo in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-20-2012, 05:54 PM
  4. Replies: 15
    Last Post: 03-27-2012, 08:48 AM
  5. [SOLVED] Query starts a "read only" copy of the source sheet
    By GorKoUSA@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2006, 08:10 AM

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