+ Reply to Thread
Results 1 to 4 of 4

Macro to copy data from one sheet, paste in another sheet

  1. #1
    Registered User
    Join Date
    07-29-2014
    Location
    Manila, Philippines
    MS-Off Ver
    2007
    Posts
    2

    Macro to copy data from one sheet, paste in another sheet

    Hi guys!

    New to the thread and this forum is great as I'm really interested in learning how to create macros.
    I would like to ask for help. I need to copy a certain group of cells from one sheet to another, and then do it for x number of times. I'm just using the record function and now i'm lost. Here is the code i currently have:

    Sheets("Mapping QTR2").Select
    Range("B137:D230").Select
    Selection.Copy
    Sheets("ExpDB_Q1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Selection.End(xlDown).Select
    Range("A99").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub

    also, column C is blank. i would like to get the values from another list in the same workbook, say "branch list". I would like to populate Column C with one specific branch for each "batch", if that makes any sense...

    hope you guys can help...

    thanks a lot
    Last edited by papi-O; 07-29-2014 at 04:29 AM.

  2. #2
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Macro to copy data from one sheet, paste in another sheet

    papi-O,

    Welcome to the forum! It would be helpful if you used code tags for posting vba code see rule 3 of the forum rules http://www.excelforum.com/forum-rule...rum-rules.html

    Recording Macros is a great way to get a start on what you want to do, but you almost never need to use the .Select method.

    You can create variables and assign or initialize these variables to things like specific workbooks, worksheets, ranges etc... For example

    Please Login or Register  to view this content.
    Now you have declared and initialized the variable to refer to exactly your current workbook and the two specific sheets in your workbook. Further....

    Please Login or Register  to view this content.
    Hope that helps get you started. Obviously it can get much more in depth with dynamic ranges (ranges that automatically find the last filled cell etc...), but this should get you started. Google is your friend as is trial and error for learning.

    Happy coding!
    If your questions has been answered to your satisfaction please don't forget to do the following:

    Add Reputation ... and ... Mark Thread as Solved

    Thanks,

    Ma 10:8b Freely you have received; freely give.

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Macro to copy data from one sheet, paste in another sheet

    try this...

    Please Login or Register  to view this content.
    Don't forget to click *

  4. #4
    Registered User
    Join Date
    07-29-2014
    Location
    Manila, Philippines
    MS-Off Ver
    2007
    Posts
    2

    Re: Macro to copy data from one sheet, paste in another sheet

    thanks guys... these are a great way to get me started....

+ 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. Copy and Paste data from different sheet - No Macro Please
    By abduljaleel.mca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2014, 10:45 AM
  2. Macro to Copy data from one sheet and paste to another sheet based on a condition
    By SaurabhShri1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2013, 09:30 AM
  3. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  4. Copy Sheet / Create & Name New Sheet / Insert Before a Sheet / Paste Data
    By thinkspac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2012, 02:27 PM
  5. Macro to search the sheet name and copy and paste the data from a major sheet
    By salma2009 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2009, 02:11 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