Excel VBA - Copy Paste Data Range From Another Worksheet or Workbook - Part 5

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 76

  • @andrewgendron1581
    @andrewgendron1581 2 ปีที่แล้ว

    WOW. Omg, I was reading through forums trying to figure out to copy a range directly underneath a table and was struggling to find clear guidance. THANK YOU SO MUCH!!

  • @andrewainger
    @andrewainger 2 ปีที่แล้ว +2

    PERFECT! Thanks, great 'story' and build up from simple Copy n Paste to ever more complex functionality.
    A wonderful format, even the 'errors' when compiling (if that's what they were really?) were beneficial, a great ploy to get us to remember stuff!
    Very many thanks . . .

  • @shellykomar
    @shellykomar 2 ปีที่แล้ว

    Thank you. I was just looking for this code and here it is. Great Explanation just trying to workout and you have explain all in one go.

  • @brendakay1220
    @brendakay1220 2 ปีที่แล้ว +1

    Thank you SO much for this! I have been trying to figure this out for ages. This is EXACTLY what I've been doing manually for years. So glad to be able to automate it. Very good tutorial. I really like how you let us see your mistakes and how you fix them. (No one gets it exactly right the first time, right?).

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 ปีที่แล้ว

      Most of the time it's not even right the second time :)

  • @hirunimarasinghe5728
    @hirunimarasinghe5728 3 ปีที่แล้ว

    Thank you very much. I was trying to write this code last two days. Finally, I found the way. Very clear instruction. This is very useful.

  • @rajaarya8773
    @rajaarya8773 2 ปีที่แล้ว

    I wish back in life to be your study buddy when you cracking rocking VBA. Happy New year bro..

  • @excel_master_habib
    @excel_master_habib 2 ปีที่แล้ว

    Thanks God Bless You i find this type video from 3 year....

  • @DendrakeCollections
    @DendrakeCollections 7 หลายเดือนก่อน

    Hi there, this is very useful and is almost what I was looking for. Would like to know how to insert the copied data to the table and shift the order data in the table downwards. Thank you.

  • @muhanadkais
    @muhanadkais 9 หลายเดือนก่อน

    Thanks for the great tutorial! How can I copy uneven column rows? For instance, column one has 5 rows and column two has 9 rows of data.

  • @fksons4161
    @fksons4161 2 ปีที่แล้ว

    Thank you so much for this detailed explanation

  • @RidwanGhibran
    @RidwanGhibran 3 ปีที่แล้ว

    You explain it very well. this really helps me who is studying it.
    thank you for the explanation you give, this is very useful.

  • @toddh6234
    @toddh6234 ปีที่แล้ว

    Great Video! I have workbook template that I copy a range of data from. I then have to paste that range into other workbooks that are generated daily. The file name(s) for the generated workbook(s) are unique. Is there a way to write the code so that I can copy from the template and paste to the active sheet of the generated workbook(s) without having to edit the code each time? Basically to be able to pull data from the clipboard and paste it without having to edit the paste portion each time for new files.

  • @chrizki456
    @chrizki456 3 ปีที่แล้ว

    You're the one I've been looking for. I love this so much!

  • @abdulrasheedpalara597
    @abdulrasheedpalara597 3 ปีที่แล้ว +1

    Great it helped me a lot.! Thank You so much

  • @metinatahan7187
    @metinatahan7187 2 ปีที่แล้ว

    Great video and tutorial!
    How to set dynamic cells range to copy instead of fixed A1:F15?

  • @shrinandbhedasgaonka
    @shrinandbhedasgaonka 3 ปีที่แล้ว

    Great! Thank you. What if I want to move existing data below & paste new data on top ? header will be remain as it is. Is it possible ?

  • @janellegriego6962
    @janellegriego6962 2 ปีที่แล้ว

    Great video. Is there a way copy and paste out the newly added information to the new workbook depending on a cells date. One of my headers has Date received. This way I don't copy over duplicates.

  • @wayneleone7071
    @wayneleone7071 3 ปีที่แล้ว +1

    Very helpful, great instructions.

  • @sushantGhosh-k4k
    @sushantGhosh-k4k ปีที่แล้ว

    Great, very helpful.

  • @zouagrimohamed3541
    @zouagrimohamed3541 4 ปีที่แล้ว

    great and nice work thanks, if we need to copy just the rows of the year for example (2018) ,so how we can filter this year in VBA ?

  • @akahn8311
    @akahn8311 3 ปีที่แล้ว +1

    Thanks for the tutorial especially with Cells.Find. I am currently running into two issues, namely
    I am getting error Object variable not set (Error 91) could you please advice what am I doing wrong.
    Secondly how to paste only cell values without format
    Thanks for your time, much appreciated

  • @vinaynimje97
    @vinaynimje97 4 ปีที่แล้ว

    Great Video... I hv one query that I have a data in one sheet and i want copy some columns data upto last row and create new file and paste data after some shorting and sum in particular columns and new file should save in particular location ... kindly help

  • @ahmadtiajafar
    @ahmadtiajafar ปีที่แล้ว

    Hallo sir, what if i wanna copy the specific row information using unique code ?

  • @alexfernandes8202
    @alexfernandes8202 11 หลายเดือนก่อน

    Sir when I use the same code logic I get an error statement invalid outside type block

  • @Lokesh_kumar156
    @Lokesh_kumar156 ปีที่แล้ว

    Hey sir .
    How to do same procedure in Google spreadsheet pls tell me sir.
    If any videos have pls send the link thank you sir

  • @sree9355
    @sree9355 2 ปีที่แล้ว

    Sir, how to copy selected cell to another cell. Example first i will select B5 and copy paste. Second i will select j4 copy and paste. So what is code for this?
    Copy cell reference is dynamic and
    Paste cell reference is fixed.
    I want to copy selected data by mouse click which should be the range.

  • @cwrobinson6363
    @cwrobinson6363 3 ปีที่แล้ว

    Does this copy paste method move cell formulas with it?

  • @jessa2526
    @jessa2526 3 ปีที่แล้ว

    Very clear instruction. But i have a question, how do i do pastespecial values?

    • @michaelgens4879
      @michaelgens4879 3 ปีที่แล้ว

      Hi - change Activesheet.paste to ActiveCell
      Then use the macro recorder (ctrl c ctrl v then select Paste method wanted) to find exact code should look something like this.
      ActiveCell.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _, SkipBlanks:=False, Transpose:=False
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _:=False, Transpose:=False

    • @jessa2526
      @jessa2526 2 ปีที่แล้ว

      @@michaelgens4879 great!, thank you

  • @kaushikraja1765
    @kaushikraja1765 3 ปีที่แล้ว

    Thanks a lot ! I have an issue here ..i created two command button in one sheet to execute the above said code. One will copy the table from the first work sheet and second button should copy from the second worksheet...for me second command button is not working. The code under one sheet cannot identify another worksheet.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 ปีที่แล้ว

      Did you name your sub differently or use he same name for both?

  • @bryonlim3183
    @bryonlim3183 ปีที่แล้ว

    Thanks!

  • @emilbek_isaev
    @emilbek_isaev 2 ปีที่แล้ว

    I've faced a situation with pasting in cells which situated in a partly defended worksheet. Would this method help me?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 ปีที่แล้ว

      Well, if the cell you are pasting to is protected, then you will need to unprotect it first, otherwise it won't be able to paste.
      You could record a macro to unprotect the sheet, copy the data and then protect the sheet again.

    • @emilbek_isaev
      @emilbek_isaev 2 ปีที่แล้ว

      @@ExcelGoogleSheets cells i want paste to are unprotected, but some others do. So i cant just copy a whole table and paste. I have to choose certain cells and paste it to certain cells. It so boring and time wasting.

  • @anandansaradha6439
    @anandansaradha6439 3 ปีที่แล้ว

    thank you .please tell me how to paste it based on cell value

  • @rajendardhar
    @rajendardhar 3 ปีที่แล้ว +1

    Thanks.

  • @erinwright7547
    @erinwright7547 2 ปีที่แล้ว

    Could you do this same thing but by referencing ever changing columns and rows? So have VBA copy every below row 30, no matter how many columns and rows?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 ปีที่แล้ว

      It's definitely possible, but solution depends on your setup.

  • @rvas1966
    @rvas1966 4 ปีที่แล้ว

    Great work... Thank you...if I want to copy 3 rows with highest value to another sheet... what we do..☺️

  • @altafmubarak
    @altafmubarak 2 ปีที่แล้ว

    bro i have a sheet which is account related and need to make a separate sheet for some other purpose , but the data which is in the debit column should be automatically entered in the credit column to the other sheet where I will write the functions , so far i am using filter option but it copy and enter the exact data and cant change the column from debit to credit .....any suggestion to this please will be a big help

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 ปีที่แล้ว

      Instead of copying the whole data, why not copy the data in the column?

    • @altafmubarak
      @altafmubarak 2 ปีที่แล้ว

      @@ExcelGoogleSheets
      There is conditional copy of that data . I.e: if the payment is being made to perticular individual only then that entire row should get copy to other sheet .....so that way only that column cant be copied

    • @altafmubarak
      @altafmubarak 2 ปีที่แล้ว

      @@ExcelGoogleSheets any personal communication will be highly appreciated please

  • @GhostRider-mz1hl
    @GhostRider-mz1hl 3 ปีที่แล้ว

    Please can you show how to add a command button? To complete the final process of copying the data from one worksheet to another worksheet, or one workbook to another workbook rather than keep clicking on the run feature in excel, thank you. Merry Christmas

  • @abdulabdihalim1261
    @abdulabdihalim1261 4 ปีที่แล้ว

    Hi, Really helpful video.
    I have a question, if I want to paste it in the last column which in my case will be column D instead of A how do I do that in the code? Because when the code pasts the data it always starts from column A, how do I make it paste differently for each column? I hope this makes sense?

  • @nsanerydah
    @nsanerydah 4 ปีที่แล้ว

    Amazing video and is 99.9% what I'm trying to do. Instead of counting the last entered cell in column "A" I just need it to perform the lrTarget on column "B". Is there a simple way of discounting column A so it looks at B for last entry? Thank you so much for your help and tutorials!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 ปีที่แล้ว

      Watch this video th-cam.com/video/NrYDAEsYcbU/w-d-xo.html

  • @ofekbar6908
    @ofekbar6908 3 ปีที่แล้ว +1

    Sub copydata()
    Sheets("data").Select
    Ir = Cells.Find("*", Cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
    Range("a2:f" & Ir).Copy
    Sheets("target book").Select
    IrTarget = Cells.Find("*", Cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
    Cells(IrTarget + 1, 1).Select
    ActiveSheet.Paste
    Columns("a:f").AutoFit
    Cells(1, 1).Select
    End Sub

  • @khaisarbegum2134
    @khaisarbegum2134 4 ปีที่แล้ว

    same code wrote using button, when i click on the button, am able to see data for one second only, can please help me why it is happening like this.

  • @andreicionca629
    @andreicionca629 4 ปีที่แล้ว

    Hi!
    Could you make a video like this for google spreadsheet?
    I want to collect data through the google forms application and then I want to move that data to another google spreadsheet file depending on certain conditions. It's a lot of data that will be sent daily and I need a script that moves them according to certain conditions in several spreadsheets.

  • @roseann8785
    @roseann8785 2 ปีที่แล้ว

    How to do this automatically? I mean copying data to another sheet automatically without clicking the run botton?

  • @navneetbajpai3601
    @navneetbajpai3601 3 ปีที่แล้ว

    Sir i have a data having large number of rows and columns. In this data there is a column having a drop down list of serviceability status i.e serviceable or non serviceable. I want that the moment i select serviceable the entire rows having serviceable text copy into another worksheet i.e sheet 2 and when i select non serviceable the entire rows having non serviceable text copy into another worksheet i.e sheet 3. Sir the third and most important requirements is that there is a column having items quantity no in this data. If items quantity is 10 and there is only 06 items are serviceable then is this possible the same row copy in both sheet 2 and sheet 3 i.e in sheet 2 same row will be copy having 6 serviceable items and in sheet 3 same row will be copy having 4 non serviceable items. Sir if this is possible using VBA or without VBA Please share with me. I will be thankful to you.

  • @gourabghoshroy7484
    @gourabghoshroy7484 4 ปีที่แล้ว

    Really useful video, but Sir, helpful if you send the code so that I can paste it into my excel script editor.

  • @loidaasar487
    @loidaasar487 3 ปีที่แล้ว

    Great tutorial! Can you please let me know why the codes i copied from you was not working
    Excel VBA - Copy Paste Data Range From Another Worksheet or Workbook - Part 5
    Sub copydata()
    Sheets("Excel").Select
    lr = Cells.Find("*", Cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
    Range("A1:D" & lr).Copy
    Sheets("New Excel").Select
    lr2 = Cells.Find("*", Cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
    Cells(lr2 + 1, 1).Select
    ActiveSheet.Paste
    Columns.AutoFit
    End Sub

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 ปีที่แล้ว

      I don't see anything wrong with this code, but at the same time I have no idea what your spreadsheet setup is like. What line gives you the error?

  • @amritnigam5991
    @amritnigam5991 4 ปีที่แล้ว

    If i am copy the data with formula in it . The value is not pasting in target sheet. The value shows as 0 (zero)

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 ปีที่แล้ว +2

      Instead of .Paste use .PasteSpecial Paste:=xlPasteValues

    • @unrapidist84
      @unrapidist84 3 ปีที่แล้ว

      @@ExcelGoogleSheets Hello, I am typing ActiveSheet.PasteSpecial Paste:=xlPasteValues and I receive error 1004. There is anything else I must do?

  • @andrewainger
    @andrewainger 2 ปีที่แล้ว +1

    I found I had to add .xlsm to the spreadsheet name(s)
    ie: Workbooks("search.xlsm")
    Don't know why, maybe because I'm running 2013?
    But otherwise really really excellent!
    Many thanks

    • @fitzs69hotmail
      @fitzs69hotmail 2 หลายเดือนก่อน

      Yes i had the same problem. Good thing i checked the comments.

  • @Norlen94
    @Norlen94 4 ปีที่แล้ว

    Hi, great video. I really need some help:
    This is a code that will enable me to select a range from 1 workbook, copy it then paste it in the last row of another workbook. The only downside I have is pasting only values. I've already spent a few hours trying to solve this but I am stuck. Someone, please help modify the code so that it only paste values.
    Sub copy_paste_Cell2()
    Dim wsCopy As Worksheet
    Dim wsDest As Worksheet
    Dim LastRow As Long
    'Set variables for copy and destination sheets
    Set selectedRange = Application.Selection
    Set wsCopy = Workbooks("New-Data.xlsx").Worksheets("Export 2")
    Set wsDest = Workbooks("Reports.xlsm").Worksheets("All Data")

    '1. Select Range to copy
    Set selectedRange = Application.InputBox("Select the range that you want to copy: ", "CopyOnlyValues", selectedRange.Address, Type:=8)

    '2. Find first blank row in the destination range
    With Workbooks("Reports.xlsm")
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row
    End With
    '3. Copy & Paste Data
    selectedRange.Copy wsDest.Range("A" & Rows.Count).End(3)(2)

    'wsDest.Activate

    End Sub

  • @shahenliza2064
    @shahenliza2064 2 ปีที่แล้ว

    h



    💍👫💕💍پیرۆزه
    🎆🎈💖💖🎂💖💖💞🎈🎆
    Happy 💋‍ Birthday
    ✤✤✤✤✤✤بابه‌ت✤✤✤✤✤✤
    💍👫💕💍پیرۆزه