hamidpatel
New Member
- Joined
- Jan 17, 2018
- Messages
- 2
Hi all,
I'm very new to VBA.
I'm trying to copy a one month data (let's name this Workbook A) and paste it on a compiled workbook of monthly data (Workbook B).
So I'm trying to figure out how to remove duplicate entries of monthly data in Workbook B, while at the same time making the data range in Workbook B dynamic.
What I have now is this:
I know that Range("$A$1:$G$3436) is not dynamic and it will be problematic as I add next month's data.
Another question is can somebody explain how the Columns and Array work?
Thanks a lot in advance!
I'm very new to VBA.
I'm trying to copy a one month data (let's name this Workbook A) and paste it on a compiled workbook of monthly data (Workbook B).
So I'm trying to figure out how to remove duplicate entries of monthly data in Workbook B, while at the same time making the data range in Workbook B dynamic.
What I have now is this:
Code:
Sub remove_duplicate()
'
' remove_duplicate Macro
'
Range("A1").Select
Selection.CurrentRegion.Select
ActiveSheet.Range("$A$1:$G$3436").RemoveDuplicates Columns:=Array(1, 2, 3, 4, 5, 6 _
, 7), Header:=xlYes
End Sub
I know that Range("$A$1:$G$3436) is not dynamic and it will be problematic as I add next month's data.
Another question is can somebody explain how the Columns and Array work?
Thanks a lot in advance!