The most helpful vba tutorial I've ever watched! Thank you so much! I had to modify a few lines since activating the source sheet didn't work for me, the row_count and col_count gave me values based on the worksheet I was importing the data to. So all the places that assumed using the active sheet, i added "ws_source." in front of like this: csv_path = "C:\Users\my_username\Documents\vba\source_data.csv" Set wb_source = Workbooks.Open(Filename:=csv_path) Set ws_source = wb_source.ActiveSheet Debug.Print "csv_path =" & csv_path row_count = WorksheetFunction.CountA(ws_source.Range("A1", ws_source.Range("A1").End(xlDown))) col_count = WorksheetFunction.CountA(ws_source.Range("A1", ws_source.Range("A1").End(xlToRight))) Debug.Print "row_count = " & row_count Debug.Print "col_count = " & col_count
@@greggowaffles Working really well thanks! I was running into an overflow issue however from the rows and columns being declared as Int rather than Long. Now all is good again
I really cannot thank you much for a brilliant tutorial there. I was trying to work on a piece and was just not able to wrap my head around it. This video solved everything and the code looks so decent and clean. Fantastic job there mate. *Subscribed the channel 🎉🎉 Keep up the good work
Hi Greg. This is very helpful. I'm creating this macro for other users to use so I've inserted a 2nd tab with comments and a macro button. Once I added a new tab, the macro does not work and the debug is highlighting the 'ws.Cells(1, 1).Select' line which I'm assuming could be because this works if there was only one tab in the workbook. How could I rewrite this if there was more than one tab?
Hello Greg, I cannot thank you enough for this incredible tutorial ! You crushed it. The question I have after watching, and following along, is what needs to happen if you header row is not starting at A1 in the data workbook? "Thisworkbook" header is located at A1 but "Activeworkbook" is starting on row A5.
Hey Greg - this has been super helpful. One question I have is do you know a way to set criteria where the data I am pulling into the new workbook matches a specific date?
Thanks For the tutorial , So i have need a code for the Active workbook specific range value Search from master book and copy . Paste Will Active Workbook .last Row . Need Some modify the code , please Help for the code ,Thanks
Hi Greg. This is amazing! Thank you for sharing. I'm trying to do a reorder of 70+ columns within a table. And then potentially delete some columns that I do not need. Background: I have 1 master report that is used for multiple teams and some teams want it cut down to a smaller amount of columns. So what I'm hoping to do is create a bunch of macros (buttons) to allow the master report that has been pasted to "worksheet2'" to modify based on the button choice. How can I create a cleaner version of reordering columns within a table? ' Daily_Shortlist Macro ' ' Range("Customize_Shortlist[[#Headers],[Recruiter Name]]").Select Selection.Cut Range("Customize_Shortlist[[#All],[Super Sector]]").Select Selection.Insert Shift:=xlToRight Range("Customize_Shortlist[[#Headers],[Hiring Manager Name]]").Select Selection.Cut Range("Customize_Shortlist[[#All],[Super Sector]]").Select Selection.Insert Shift:=xlToRight Range("Customize_Shortlist[[#Headers],[Posting Status]]").Select Selection.Cut Range("Customize_Shortlist[[#All],[Super Sector]]").Select Selection.Insert Shift:=xlToRight Range("Customize_Shortlist[[#Headers],[Status]]").Select Selection.Cut Range("Customize_Shortlist[[#All],[Super Sector]]").Select Selection.Insert Shift:=xlToRight Range("Customize_Shortlist[[#Headers],[Senior Leader]]").Select Selection.ListObject.ListColumns(15).Delete Selection.ListObject.ListColumns(15).Delete Selection.ListObject.ListColumns(15).Delete Selection.ListObject.ListColumns(15).Delete Range("Customize_Shortlist[[#Headers],[Job Title(2)]]").Select Selection.Cut Range("Customize_Shortlist[[#All],[Super Sector]]").Select Selection.Insert Shift:=xlToRight End Sub
Hello Greg - this is the closest I’ve come to solving a problem! Thanks! I am looking to run this through a dynamic workbook I have been creating. What would advise on troubleshooting for no returns ? I am working with a large data set A1:AS1220 and various data types, copying this code did not work. Also need tips on how to copy filtered data.
works great ,but one problem , i have columns that have formulas and dates , and double or single variables , what should i change in this code so it does copy everything ?
Hello Greg can you please modify the code as i want to paste the specific columns into a workbook but this workbook already has some data so i want to paste it below that. Mainly to the last available row of ws workbook. Can you please help me with that.
I'm not a coder. I need help with my spreadsheet. I need to move data from a specific column to another sheet using a button. It's data from a pricing sheet to an invoice.
Hello, thanks for the video. I tried fetching data for 15 columns out of 120 columns but my destination sheet is blank. I don’t get any error message. Please help me out.
Hi. Firstable thnx for the video its really hopefull. Then onlyn trouble ive got its that the columns i wanna import and match with the text of the header starts in A:3 i tried different stuff without sucess. Any idea please?
Hi, I just found your channel. Y ou are amazing. You have helped me a lot so Thank You! I have a question. How do I write a macro code that refers to a list of delimiters in a lookup table in excel to remove any delimiter used in a column copied from a CSV file?
Hi Greg. I love all your tutorials as they are very practical and great code. There are some that you do not provide code and the screen hard to see even though I used to screenshot & magnify it I could not see either the colon, comma, colon lower L or 1. Very confusing when copying down your code. Videos with your code provided & clear screen help us so much and always received the most liked and I hope more will subscribe too. Your valuable time to make our lives easier, happier is always greatly appreciated. I always liked from the beginning class even though sometimes the program could not run smoothly because of the visibility. It took me sometimes to figure out ex: rg1 (it is number 1 but I write as L lower case) or criteria1 (number 1 but I wrote as letter L lower case) or the equal sign - I wrote as hyphen -. It would be nice if you could spell it out these little things or zoom the screen closer so that we can see better. Greatful for your hard work. thank you very much Greg!
@@greggowaffles You're genius coder and with strong passion to help people I believe you're successful. The number of subscribers will be increasing once you attach codes along with tutorials. 🙏
Please help me!! I want basically this however its not got a header. How do i create a macro in one workbook asking it to pull data from another workbook but by range.? I have four ranges c9:c130, GC9:GC130, GD9:GD130 and GG9:GG130 Is this even possible?
Hi, this one really helped but got some questions. Does this pull the data which is only text format? I tried the same codes but I m unable to pull the data from read only file
Hello greg. I need help with macro on how to auto filter, copy and save to new multiple workbooks a raw sheet and a summary sheet. So basically i have the first sheet as raw data and the second worksheet as with pivot table summary. Hope you can see this.
Great video! Using your example, how could I make it so it only pulled specific information? For example only want the data to pull if population is >= 150000
Lots of good videos I've already seen and they've really helped me! So thank you! I'm currently investigating the ability of one excel document to pull information from another document. Two questions I have so far in this: 1. Is it possible to make the file path adaptable? Where the document name can be changed but the column locations and everything are in the same location in every version of the document? 2. Does all of this work whether you are in a normal file explorer or Microsoft Teams? I apologize, I've been working in Excel VBA for about 6 months now, but I have so much more to go, so I imagine this will not be the last time you will see me in your comments haha. I have managed to do a number of things with what I've learned, including changing a duplicate detection and deletion code to what I needed it to do, but I can't say for sure if it is the most efficient method possible. Thanks!
thanks for watching!! 1. yeah, definitely. you can use wildcards and all that 2. not exactly sure. i'll have to look into that apologies for the late reply btw! 😅
Hello, thanks for sharing this it is amazing..... I have tried this it work very well.... I have one question on this can we extract data from multiple files at one shot ...
Hi, bro.... i'm really appreciated for this job. i tried to do it and followed all your path but it still not run yet. it shows run time erro '438' Object doesn't support this property or method. please help me out to fix this error. i use excel 2010. thanks in advance.
Amazing, Very Good Stuff... Can you also add a column and put the sheet name there. How to get data into one sheet if other workbook has multiple sheet (By country) with same header and column ?
This is a very nice share to us. I would like to add what if the header name is different from another worksheet/workbook (e.g. Population and Population (in K) )
@@greggowaffles great it worked for me.. PS for all please note no header should be blank otherwise data wont be pulled, recommendation to author, to use in a title pull data from excel based on header values
application defined or object defined error on below lines ActiveSheet.Range(Cells(1, j), Cells(row_count, j)).Copy ws.Cells(1, i).PasteSpecial xlPasteValues
Thank you so much!! You literally saved my internship
No problem!! 👊😎
The most helpful vba tutorial I've ever watched! Thank you so much!
I had to modify a few lines since activating the source sheet didn't work for me, the row_count and col_count gave me values based on the worksheet I was importing the data to. So all the places that assumed using the active sheet, i added "ws_source." in front of like this:
csv_path = "C:\Users\my_username\Documents\vba\source_data.csv"
Set wb_source = Workbooks.Open(Filename:=csv_path)
Set ws_source = wb_source.ActiveSheet
Debug.Print "csv_path =" & csv_path
row_count = WorksheetFunction.CountA(ws_source.Range("A1", ws_source.Range("A1").End(xlDown)))
col_count = WorksheetFunction.CountA(ws_source.Range("A1", ws_source.Range("A1").End(xlToRight)))
Debug.Print "row_count = " & row_count
Debug.Print "col_count = " & col_count
Niiiice!! Glad it was helpful and that you got it working on your end!!
@@greggowaffles Working really well thanks! I was running into an overflow issue however from the rows and columns being declared as Int rather than Long. Now all is good again
Thank you man. Is there a way to pull columns from multiple sheets than just 1
This code is really great and simple Greg thanks
Glad you like it!
I really cannot thank you much for a brilliant tutorial there. I was trying to work on a piece and was just not able to wrap my head around it. This video solved everything and the code looks so decent and clean.
Fantastic job there mate.
*Subscribed the channel 🎉🎉
Keep up the good work
Thank you so much for the feedback! I’ll keep doing my best!!
A very useful tutorial explained in an excellent way
Thank you!!
How do you pull columns in across multiple workbooks ??
How to possible?
Hi Greg, Thank you very much for your videos, it's really helping me.
So glad to hear that! I’ll start making more soon!! Thanks for the motivation
Hey Greg.. can you help with code for multiple worksheet.
Hi Greg. This is very helpful. I'm creating this macro for other users to use so I've inserted a 2nd tab with comments and a macro button. Once I added a new tab, the macro does not work and the debug is highlighting the 'ws.Cells(1, 1).Select' line which I'm assuming could be because this works if there was only one tab in the workbook. How could I rewrite this if there was more than one tab?
Hi Greg, this is fantastic, thank you very much this is a great help and very well explained
Glad it helped and appreciate the feedback!!
Hello Greg, I cannot thank you enough for this incredible tutorial ! You crushed it.
The question I have after watching, and following along, is what needs to happen if you header row is not starting at A1 in the data workbook? "Thisworkbook" header is located at A1 but "Activeworkbook" is starting on row A5.
Hi Greg, will be helpful if you could give a solution for this.
Hey Greg - this has been super helpful. One question I have is do you know a way to set criteria where the data I am pulling into the new workbook matches a specific date?
Thanks for this.
How to add to the first available row in the same code, if you can please reply.
Thanks
Thanks For the tutorial , So i have need a code for the Active workbook specific range value Search from master book and copy . Paste Will Active Workbook .last Row . Need Some modify the code , please Help for the code ,Thanks
hi Greg tks so much for the sharing ! btw how can i workout if i want to copy multiple sheets with selected column to a same destination sheet?
Thanks for the video.the challenge I have is that the macro is not copying and pasting the last four records. Please help
Hi Greg. This is amazing! Thank you for sharing. I'm trying to do a reorder of 70+ columns within a table. And then potentially delete some columns that I do not need.
Background: I have 1 master report that is used for multiple teams and some teams want it cut down to a smaller amount of columns. So what I'm hoping to do is create a bunch of macros (buttons) to allow the master report that has been pasted to "worksheet2'" to modify based on the button choice.
How can I create a cleaner version of reordering columns within a table?
' Daily_Shortlist Macro
'
'
Range("Customize_Shortlist[[#Headers],[Recruiter Name]]").Select
Selection.Cut
Range("Customize_Shortlist[[#All],[Super Sector]]").Select
Selection.Insert Shift:=xlToRight
Range("Customize_Shortlist[[#Headers],[Hiring Manager Name]]").Select
Selection.Cut
Range("Customize_Shortlist[[#All],[Super Sector]]").Select
Selection.Insert Shift:=xlToRight
Range("Customize_Shortlist[[#Headers],[Posting Status]]").Select
Selection.Cut
Range("Customize_Shortlist[[#All],[Super Sector]]").Select
Selection.Insert Shift:=xlToRight
Range("Customize_Shortlist[[#Headers],[Status]]").Select
Selection.Cut
Range("Customize_Shortlist[[#All],[Super Sector]]").Select
Selection.Insert Shift:=xlToRight
Range("Customize_Shortlist[[#Headers],[Senior Leader]]").Select
Selection.ListObject.ListColumns(15).Delete
Selection.ListObject.ListColumns(15).Delete
Selection.ListObject.ListColumns(15).Delete
Selection.ListObject.ListColumns(15).Delete
Range("Customize_Shortlist[[#Headers],[Job Title(2)]]").Select
Selection.Cut
Range("Customize_Shortlist[[#All],[Super Sector]]").Select
Selection.Insert Shift:=xlToRight
End Sub
Hello Greg - this is the closest I’ve come to solving a problem! Thanks!
I am looking to run this through a dynamic workbook I have been creating. What would advise on troubleshooting for no returns ?
I am working with a large data set A1:AS1220 and various data types, copying this code did not work.
Also need tips on how to copy filtered data.
What’s the software You are using Now?
Hi Greg its help me a lot but i have to paste data in other sheet & create multiple forms from master sheet, how can i do it ?
works great ,but one problem , i have columns that have formulas and dates , and double or single variables , what should i change in this code so it does copy everything ?
Hello Greg can you please modify the code as i want to paste the specific columns into a workbook but this workbook already has some data so i want to paste it below that. Mainly to the last available row of ws workbook. Can you please help me with that.
Did you ever figure this out?
Great tutorial! I m getting a Run-time 1004 error and I am not sure where I went wrong. Can you assist?
very much thankful to u for this video...
I'm not a coder. I need help with my spreadsheet. I need to move data from a specific column to another sheet using a button. It's data from a pricing sheet to an invoice.
excellent demonstration...
Thanks!
how about adding another data from another sheet? thanks if you'll notice
Hello, thanks for the video.
I tried fetching data for 15 columns out of 120 columns but my destination sheet is blank. I don’t get any error message. Please help me out.
Hi Greg, this is great, but when i tried, why did it only copy and paste to Coloum 1 only. where I have 6 headers and all matched. Any idea why ?
Hi. Firstable thnx for the video its really hopefull. Then onlyn trouble ive got its that the columns i wanna import and match with the text of the header starts in A:3 i tried different stuff without sucess. Any idea please?
its wonderfull, short vba code for excellent report generation
Thank you!
do u have the data file for this.
Hi, I just found your channel. Y
ou are amazing. You have helped me a lot so Thank You! I have a question. How do I write a macro code that refers to a list of delimiters in a lookup table in excel to remove any delimiter used in a column copied from a CSV file?
Thank you! Glad to hear that! When you say “remove”, do you want to delete that cell, the contents of the cell, or the column itself?
How do we do the same, using arrays?
Hi Greg. I love all your tutorials as they are very practical and great code. There are some that you do not provide code and the screen hard to see even though I used to screenshot & magnify it I could not see either the colon, comma, colon lower L or 1. Very confusing when copying down your code. Videos with your code provided & clear screen help us so much and always received the most liked and I hope more will subscribe too. Your valuable time to make our lives easier, happier is always greatly appreciated. I always liked from the beginning class even though sometimes the program could not run smoothly because of the visibility. It took me sometimes to figure out ex: rg1 (it is number 1 but I write as L lower case) or criteria1 (number 1 but I wrote as letter L lower case) or the equal sign - I wrote as hyphen -. It would be nice if you could spell it out these little things or zoom the screen closer so that we can see better. Greatful for your hard work. thank you very much Greg!
Thanks! I’ll do better with that. And I’ll get the code added for all of my older videos
@@greggowaffles You're genius coder and with strong passion to help people I believe you're successful. The number of subscribers will be increasing once you attach codes along with tutorials. 🙏
I really appreciate that!!
Please help me!! I want basically this however its not got a header. How do i create a macro in one workbook asking it to pull data from another workbook but by range.?
I have four ranges c9:c130, GC9:GC130, GD9:GD130 and GG9:GG130
Is this even possible?
Hi, this one really helped but got some questions. Does this pull the data which is only text format? I tried the same codes but I m unable to pull the data from read only file
Hi Thanks for the such h valuable video but i have try this but it's only pulled 15 row data not to the bottom why i don't know please help me out
Hi Greg code working but data no pasted
mine can’t paste the values, it only closes the destination workbook 😅
Hello greg. I need help with macro on how to auto filter, copy and save to new multiple workbooks a raw sheet and a summary sheet. So basically i have the first sheet as raw data and the second worksheet as with pivot table summary. Hope you can see this.
i hope this video helps!! th-cam.com/video/unUgUlEBvu4/w-d-xo.html i'll be making videos on using excel vba with pivot tables soon
hi all, I was using this vba code in a project but as from yesterday it stops to copy in the destination excel.
Can anyone help
Great video! Using your example, how could I make it so it only pulled specific information? For example only want the data to pull if population is >= 150000
Thank you so much Sir
Lots of good videos I've already seen and they've really helped me! So thank you!
I'm currently investigating the ability of one excel document to pull information from another document. Two questions I have so far in this:
1. Is it possible to make the file path adaptable? Where the document name can be changed but the column locations and everything are in the same location in every version of the document?
2. Does all of this work whether you are in a normal file explorer or Microsoft Teams?
I apologize, I've been working in Excel VBA for about 6 months now, but I have so much more to go, so I imagine this will not be the last time you will see me in your comments haha. I have managed to do a number of things with what I've learned, including changing a duplicate detection and deletion code to what I needed it to do, but I can't say for sure if it is the most efficient method possible.
Thanks!
thanks for watching!!
1. yeah, definitely. you can use wildcards and all that
2. not exactly sure. i'll have to look into that
apologies for the late reply btw! 😅
Awesome Video,. Would be great help if we will be able to do the same thing from multiple workbooks.
Hello, thanks for sharing this it is amazing..... I have tried this it work very well.... I have one question on this can we extract data from multiple files at one shot ...
Hi, bro.... i'm really appreciated for this job. i tried to do it and followed all your path but it still not run yet. it shows run time erro '438' Object doesn't support this property or method. please help me out to fix this error. i use excel 2010. thanks in advance.
Hi greg, this is great, what if I'm pulling the data from the same workbook but in a different sheet
Me too, same taks
hope this helps! th-cam.com/video/FxJpUajNOVs/w-d-xo.html
greatwork buddy
Thanks!
Amazing, Very Good Stuff... Can you also add a column and put the sheet name there.
How to get data into one sheet if other workbook has multiple sheet (By country) with same header and column ?
I have a workbook with 800 column...code is opening the workbook but not copying to other
Data header starts from 5th row what to do ???? Please help
row_count = WorksheetFunction.CountA(Range("A5", Range("A5").End(xlDown))) + 4
This is a very nice share to us. I would like to add what if the header name is different from another worksheet/workbook (e.g. Population and Population (in K) )
You could use an if statement that uses the string “Population (in K)” instead of the cell
@@greggowaffles Thanks for the reply. Will try to sort like that.
No prob!
Today after asking chatgpt this question again and again couldnt find the solution. Thats what i wanted.. Will test tomorrow
Happy to help!
@@greggowaffles great it worked for me.. PS for all please note no header should be blank otherwise data wont be pulled, recommendation to author, to use in a title pull data from excel based on header values
Thanks! I will make that update in the title
application defined or object defined error on below lines
ActiveSheet.Range(Cells(1, j), Cells(row_count, j)).Copy
ws.Cells(1, i).PasteSpecial xlPasteValues
Hi I am having the same error , did you get the way out?
Awesome!!!! Point Blank... Bulls Eye... :)
🎯🤏😎
if possible kindly update greg