novice_at_VBA
New Member
- Joined
- Nov 13, 2017
- Messages
- 2
Firstly i apologise if this has been answered before but i am getting myself more confused the more i look.
I am trying to set a macro / vba up to copy data from about 74 sheets and paste into a sheet called "Master", the problem i have is that i have a number of other sheets I do not want to obtain data from, these are "Summary sheet", "individual Monthly data", "individual continued", "YTD Data Sheet" & "Hidden data"
The sheets i want to copy from may or may not have data in them and the amount of rows can vary so i want something that looks until a blank row if that makes sense? The data will appear on row 7 (if there is any data) and i need to copy Cell B7 and C7 on the row and any below but if blank no copy needed. (both cells can contain mixed data text&numbers)
The other piece of help needed would be to remove the duplicates in the master sheet once data has been obtained.
I found some coding and tried to alter it but clearly it will not do what i need at the moment (in master sheet I would like data in column A & B with a header
Sub CombineData()Dim Sht As Worksheet
For Each Sht In ActiveSheet.Worksheets
If Sht.Name <> "Master" And Sht.Range("b7").Value <> "" Then
ActiveSheet.Select
Lastrow = Range("A65536").End(xlUp).Row
Range("B7", Cells(Lastrow, "C")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
ActiveSheet.Next.Select
Thank you in advance
Total Novice
I am trying to set a macro / vba up to copy data from about 74 sheets and paste into a sheet called "Master", the problem i have is that i have a number of other sheets I do not want to obtain data from, these are "Summary sheet", "individual Monthly data", "individual continued", "YTD Data Sheet" & "Hidden data"
The sheets i want to copy from may or may not have data in them and the amount of rows can vary so i want something that looks until a blank row if that makes sense? The data will appear on row 7 (if there is any data) and i need to copy Cell B7 and C7 on the row and any below but if blank no copy needed. (both cells can contain mixed data text&numbers)
The other piece of help needed would be to remove the duplicates in the master sheet once data has been obtained.
I found some coding and tried to alter it but clearly it will not do what i need at the moment (in master sheet I would like data in column A & B with a header
Sub CombineData()Dim Sht As Worksheet
For Each Sht In ActiveSheet.Worksheets
If Sht.Name <> "Master" And Sht.Range("b7").Value <> "" Then
ActiveSheet.Select
Lastrow = Range("A65536").End(xlUp).Row
Range("B7", Cells(Lastrow, "C")).Copy
Sheets("Master").Select
Range("A65536").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
ActiveSheet.Next.Select
Thank you in advance
Total Novice