+ Reply to Thread
Results 1 to 7 of 7

Copy value cells between sheets to update

  1. #1
    Registered User
    Join Date
    01-13-2012
    Location
    SLD
    MS-Off Ver
    Excel 2010
    Posts
    73

    Copy value cells between sheets to update

    I have a data table, some of the info is from the Draft sheet.

    The Draft sheet is the sheet that is used only to calculate/collect some values. Is there any way to copy all those value data from those cells to the correspondant cells in Data Input sheet?

    When I'm done with this entry for Product 1 I will do exactly the same like that for the next Product. (Surely that I change the data in Draft sheet for that product.)

    If this can be done by macro so I'm zero at it but if there is no other way can any one create a macro for me I'll see about it and may change it as neccessary.

    Many many thanks
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Copy value cells between sheets to update

    Hi vietdieu,

    What is the identifying factor basis which the values will move from Draft sheet to Draft Input sheet or is it always going to be the fixed reference as you have mentioned in draft sheet e.g. To E4 , To J4 etc.. ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,647

    Re: Copy value cells between sheets to update

    @dilipadey,
    I guess that Draft sheet like an input form with Save Button which tranfer data to corresponding cells in Data Input sheet .
    Each time confirm by button pressed, new record set is produced in next row of Data Input for next product (product2)
    The only choice in my opinion is VBA.
    Quang PT

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Copy value cells between sheets to update

    Ok. So reference would be fixed and new data will keep on appending on the other sheet.

    Yes only solution would be vba.

    Reards,
    DILIPandey

    <click on below star if this helps>

  5. #5
    Registered User
    Join Date
    01-13-2012
    Location
    SLD
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Copy value cells between sheets to update

    As I'm total new to VBA so I tried to Record a macro that copy all the cell/range into the other sheet. Now for example, I copy the C7 from the Draft, instead of copying to E3 I will copy to the last row that have text, this is can be done by using COUNTA the Col C that input new product. So how can I modify the line Range("E3").Select
    and the same with G3 and J3.

    Please give me some help here,

    Tks


    Please Login or Register  to view this content.
    Last edited by vietdieu; 01-19-2012 at 10:16 PM.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,647

    Re: Copy value cells between sheets to update

    @vietdieu
    to move to cell (B4) next row of a last non-blank cell of B coulmn (B3) we use:
    PHP Code: 
    Range("B65000").Select
    Selection
    .End(xlDown).Select
    Selection
    .End(xlUp).Select
    Selection
    .Offset(1).Select 
    The following code will produce a new record for new product at next row:
    PHP Code: 
    Sub CopyValue()
        
    Sheets("Draft").Select
        Range
    ("C7").Select
        Selection
    .Copy
        Sheets
    ("Data Input").Select
        Range
    ("E2100").Select
        Selection
    .End(xlDown).Select
        Selection
    .End(xlUp).Select
        Selection
    .Offset(1).Select
        Selection
    .PasteSpecial Paste:=xlPasteValuesOperation:=xlNoneSkipBlanks _
            
    :=FalseTranspose:=False
      
        Sheets
    ("Draft").Select
        Range
    ("e10:f10").Select
        Selection
    .Copy
        Sheets
    ("Data Input").Select
        Range
    ("g2100").Select
        Selection
    .End(xlDown).Select
        Selection
    .End(xlUp).Select
        Selection
    .Offset(1).Select
        Selection
    .PasteSpecial Paste:=xlPasteValuesOperation:=xlNoneSkipBlanks _
            
    :=FalseTranspose:=False
            
        Sheets
    ("Draft").Select
        Range
    ("e3:f3").Select
        Selection
    .Copy
        Sheets
    ("Data Input").Select
        Range
    ("j2100").Select
        Selection
    .End(xlDown).Select
        Selection
    .End(xlUp).Select
        Selection
    .Offset(1).Select
        Selection
    .PasteSpecial Paste:=xlPasteValuesOperation:=xlNoneSkipBlanks _
            
    :=FalseTranspose:=False
        End Sub 
    This code is recorded from Macro, without edition.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-13-2012
    Location
    SLD
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Copy value cells between sheets to update

    This is GREAT help, thanks you so much! By the way you also gave me a great idea of checking the col we need to paste the value (I thought of the first col like Product which is not really good).

+ 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