Тёмный

Copy Non Blank Data from Sheet1 to Sheet2 

Dinesh Kumar Takyar
Подписаться 114 тыс.
Просмотров 25 тыс.
50% 1

Опубликовано:

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@ImPeanuts
@ImPeanuts 2 года назад
Hi Dinesh, I'm not sure if you are still monitoring this page but I've tried to execute this code and am getting an error: Run-time error '9': Subscript out of range. The line in Question is Sheets("sheet5").range(Cells(i, 1), Cells(i, 2))).Copy Note: My sheet # is 5. When I hover over the Cells(i, 1) and Cells(i, 2) i do see the correct values of those cells in the other sheet.
@TOUFIKELASATEY
@TOUFIKELASATEY 8 лет назад
Thank you for your all efforts. Excel is easy with your modules.
@nickolaskaiser447
@nickolaskaiser447 3 года назад
I guess im asking the wrong place but does someone know a trick to get back into an instagram account..? I somehow lost my password. I would love any help you can offer me
@rorycayson9222
@rorycayson9222 3 года назад
@Nickolas Kaiser Instablaster :)
@nickolaskaiser447
@nickolaskaiser447 3 года назад
@Rory Cayson Thanks for your reply. I found the site through google and I'm trying it out atm. Seems to take quite some time so I will get back to you later when my account password hopefully is recovered.
@nickolaskaiser447
@nickolaskaiser447 3 года назад
@Rory Cayson it did the trick and I actually got access to my account again. I am so happy! Thanks so much you really help me out!
@rorycayson9222
@rorycayson9222 3 года назад
@Nickolas Kaiser Glad I could help :D
@matyasmandity3434
@matyasmandity3434 5 лет назад
Thank you for help! Simle and magnificent sollution for my problem.
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Glad the video helped. Thanks for the feedback.
@krn14242
@krn14242 8 лет назад
Thanks Dinesh. Great job.
@sandipmakwana6462
@sandipmakwana6462 2 года назад
Thanks a lot Sir
@Exceltrainingvideos
@Exceltrainingvideos 2 года назад
All the best
@vinayakvagare405
@vinayakvagare405 5 лет назад
Sir I ve one excel sheet, in which i dont want copy option enabled. (Means not allow to copy and paste by any method), is it possible?
@SURESH40879
@SURESH40879 5 лет назад
Thank u sooo. Much sir. Could u pls help to get data from the serial com port a sheet.
@bobcatstd
@bobcatstd 5 лет назад
Hi Dinesh, Thanks for your tutorial. I am having some issues. I get a - run time error '9', Subscript out of Range. When I try to run this code. What is the issue? I have made sure it is referencing the right sheets but i don't understand the issue. Please help
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
One easy way to solve this problem is to look in the Project Explorer window, and check the list of sheets for the active workbook.
@caedhh-bcconference9342
@caedhh-bcconference9342 6 лет назад
Hi Dinesh. Thank you for your step by step video. I'd like some clarification on a 424 error I'm getting. I'm clueless about VBA so I've copied your formula exactly as you wrote it. The only difference is my first sheet is called "All" and the second sheet is called "Secular". The error highlights the 3rd line (lastrow=etc...) as erroneous. I can't figure out what's wrong. I saved the code as a xlsm file in order to enable macros. I inserted the button as you suggested and when I ran the macro, it gave me the error listed above. Here's my code. Sub copyNonBlankDataSecular() Dim erow As Long, lastrow As Long, i As Long lastrow = All.Cells(Rows.Count, 1).End(xlUp).Row For i = 2 To lastrow If All.Cells(i, 1) “” Then Sheets("All").Range(Cells(i, 1), Cells(i, 2)).Copy Sheets("Secular").Activate erow = Secular.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row ActiveSheet.Paste Destination:=Sheets("Secular").Range(Cells(erow, 1), Cells(erow, 2)) Sheets(“All”).Activate End If Next i Application.CutCopyMode = False End Sub
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
lastrow = Sheets("All").Cells(Rows.Count, 1).End(xlUp).Row
@glenntolentino7247
@glenntolentino7247 6 лет назад
hi Dinesh i tried you code and it works. but i have more than 2 columns of data to copy and paste, when i added the other columns, i'm getting run time error 450 for the below line: For i = 3 To lastRow If Sheet1.Cells(i, 2) "" Then Sheets("sheet1").Range(Cells(i, 2), Cells(i, 3), Cells(i, 4)).Copy >>>> (run time error 450 when I added the Cells(i,4)) Sheets("sheet2").Activate erow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row ActiveSheet.Paste Destination:=Sheets("sheet2").Range(Cells(erow, 1), Cells(erow, 2), Cells(erow, 3)) >>>>added Cells(erow,3) Sheets("sheet1").Activate End If I added the Cells(i,4) since i have 3 columns of data. how to write this properly?
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Sheets("sheet1").Range(Cells(i, 2), Cells(i, 3), Cells(i, 4)).Copy ---> Sheets("sheet1").Range(Cells(i, 2), Cells(i, 4)).Copy
@thomasbruel4564
@thomasbruel4564 3 года назад
@@Exceltrainingvideos Hi Dinesh. I would like to copy cells from specific coloumns A, C, G, K, N, V, W, AD, AF, if A is not blank. And I would like them to be pasted with no blank columns: A to A, C to B, G to C, K to D N to E.... Could you please help me with this code ? Thank you so much Brgds Thomas
@zaszzman
@zaszzman 5 лет назад
i have a question i notice when you define the Lastrow you type ( lastrow=sheet1.cells(rows.count,1).end(xlup).row ) when i type that statement i get a compile error in VBA stating --> Compile Error: Expected: ( can you help resolve?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Check here: www.exceltrainingvideos.com/copy-non-blank-data-from-sheet1-to-sheet2-with-vba/
@rajpandit3807
@rajpandit3807 Год назад
how to copy more then two column data.. Worksheets("Audits").Range(Cells(i, 1), Cells(i, 2), Cells(i, 3)).Copy -----> given Error
@BegiTuBerbagiInformasiTutorial
Thank you. Could you please help me if using pastespecial?
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Watch my latest video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hi8fNycR_lU.html
@Excellent625
@Excellent625 6 лет назад
Dear sir, First o all, I would like to say thank you for your help. I have copied the same code from the link given, but I got an error 1004 saying " Application defined or object defined error" One point more, can I use this formula with rows with formulas? I need only the rows that has a result (Not "") to be copied and pasted. Thank you sir Thamer
@Exceltrainingvideos
@Exceltrainingvideos 6 лет назад
Copy paste from website does not work with code: www.exceltrainingvideos.com/copy-non-blank-data-from-sheet1-to-sheet2-with-vba/
@nixwhat
@nixwhat 5 лет назад
Your problem is probably in the (xlUp) sections. it's an L, not a 1.
@maheshkumarkakumaani9455
@maheshkumarkakumaani9455 5 лет назад
Hi Sir, What is the code ? If I want to copy empty cells of column A as well. Plz help me. Or views also help me plz
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Copy blank cells?!!?
@maheshkumarkakumaani9455
@maheshkumarkakumaani9455 5 лет назад
@@Exceltrainingvideos yes, for example column A1:100 I have a data and there are few empty cells in middle. So I want to copy A1:100 with empty cells as well
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
Just do the copying as usual from the range: Worksheets("sheet1").Range("A1:A100").Copy Destination:=Worksheets("Sheet2").Range("A1:A100")
@maheshkumarkakumaani9455
@maheshkumarkakumaani9455 5 лет назад
@@Exceltrainingvideos thank you very much sir. It is working...
@sagardas877
@sagardas877 4 года назад
Sir, thank you! Sir, if I could get your email ID I had some work process would like to learn.
@Exceltrainingvideos
@Exceltrainingvideos 4 года назад
takyardinesh@gmail.com No promises.
@Learner566
@Learner566 5 лет назад
sir plz make a video for how to tranasfer last entry row data automatically to onther workbook master sheet blank row . only data not formula . our header same two workbook. plz help sir
@Exceltrainingvideos
@Exceltrainingvideos 5 лет назад
This should be pretty easy: 1. Identify the last row of data in the relevant worksheet 2. Copy the data 3. Open the other workbook 4. Find the next blank row 5. Paste the data You can optimize the code to one line of code by copying from the source and pasting it into the destination using suitable paths.
Далее
ITZY 예지한테 AI 메이크업하기💖 #shorts
00:23
Copy Paste Data repeatedly from Sheet1 to Sheet2
9:41