+ Reply to Thread
Results 1 to 7 of 7

Move datd from one sheet to another using VBA

  1. #1
    Registered User
    Join Date
    12-08-2015
    Location
    London, England
    MS-Off Ver
    MS365 Version 2301
    Posts
    68

    Move datd from one sheet to another using VBA

    Hi

    I have one excel file with two sheets, sheet 1 contains approx 3500 rows of date which can de indentified by a code in column A it also has header which are numbered 1-25 (columns). In sheet two column A also contains a code which will match a code in sheet 1. Sheet 2 also contains some numbers in columns which have a header number which can be any number from 1-25 and i need to be able to click a button which will match a code from sheet 2 and take the numbers out of the columns and insert them into the correct column in sheet 1

    I have looked at many solutions but just cannot figure out how to do this, please see attached images.

    The column in sheets two will change there could be between 1 to 25 columns at any time as the columns only exist where there is data.

    thank you.

    Sheet1.PNG

    Sheet2.PNG
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Move datd from one sheet to another using VBA

    Find the correct column and row, then place the data in that cell.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-08-2015
    Location
    London, England
    MS-Off Ver
    MS365 Version 2301
    Posts
    68

    Re: Move datd from one sheet to another using VBA

    thank you that code works great and is really clean, this is part of a larger project i'm working on and i need this code to work in my file which is set out a bit different from the example.

    sheet 2 remains the same but sheet 1 has the code in the following column BE25 to BE4284 and the data the numbers go from K25 to AY25 down to K4284 to AY4284 how can i make your code fill this range on my new sheet 1?

    thank you.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Move datd from one sheet to another using VBA

    Change it to the actual ranges you want to search.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-08-2015
    Location
    London, England
    MS-Off Ver
    MS365 Version 2301
    Posts
    68

    Re: Move datd from one sheet to another using VBA

    Thank you i ran the code as seen below i get no error but also no data is inserted maybe i have the ranges set up wrong.

    Please Login or Register  to view this content.
    Sheet1 new.PNG


    '
    End Sub

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Move datd from one sheet to another using VBA

    Looking at the image, the row is 23 not 25

  7. #7
    Registered User
    Join Date
    12-08-2015
    Location
    London, England
    MS-Off Ver
    MS365 Version 2301
    Posts
    68

    Re: Move datd from one sheet to another using VBA

    Sorry it was my mistake thank you works brilliantly.

+ 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. [SOLVED] Macros To Move Multiple Rows To Another Sheet And Macro To Move Single Rows To DAX Table
    By jcaynes in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2013, 05:08 PM
  2. Replies: 2
    Last Post: 08-27-2013, 05:01 PM
  3. Replies: 2
    Last Post: 05-27-2013, 11:21 PM
  4. Split Data Unique Value From 2 Sheet of A column and Move to 2 Sheet with Splited Values
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2013, 04:21 AM
  5. VBA CODE to move rows from one sheet(1) to another sheet(2) based on data in cell
    By fozzieulo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 02:43 PM
  6. [SOLVED] Move rows of data from one sheet to another based on specific values of sheet
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-26-2013, 06:21 AM
  7. [SOLVED] Copy row from sheet 1 to next row in sheet 2. delete from sheet 1 and move rows up
    By papabob1954 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-16-2012, 09:38 PM
  8. [SOLVED] Move datasets sheet to sheet based on list in different sheet
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-25-2011, 04:45 AM

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