Hi All I am new to VBA excel, currently I am doing a major project. For this project, every week I will receive new data updates from information company about the percentage of emails we have collected.
My purpose is to create codes so that immediately after I receive the excel from the information counter I can copy the set of data into my master list.
However the problem is that every week the excel column change and I have to only paste 3 specific excels. So how can I make this dynamic? The method I have decided to adopt is to use userform, where the user can specify what column range and row to copy their data from (as shown in the image). However, I do not know how or where to start.
Below is the codes which I have done so far:
But it gives back error: Run Time error 13: Type mismatch
&
another problem it does not allow me to actually specify which column and row I want to extract my data from.
My purpose is to create codes so that immediately after I receive the excel from the information counter I can copy the set of data into my master list.
However the problem is that every week the excel column change and I have to only paste 3 specific excels. So how can I make this dynamic? The method I have decided to adopt is to use userform, where the user can specify what column range and row to copy their data from (as shown in the image). However, I do not know how or where to start.
Below is the codes which I have done so far:
Code:
Private Sub transferSpecificData()
Dim percentagecollected As Single
Dim noofemail As Single
Dim totalemail As Single
Dim monthlytransferdata As Workbook
Set monthlytransferdata = Workbooks.Open("C:\Users\A9901965\Documents\Jinn\Major Project\VBA Coding\latest\Transfer Monthly Data.xlsb")
Worksheets("Email_AR NTB (3)").Select
percentagecollected = Range("H:H")
Workbooks.Open ("C:\Users\A9901965\Documents\Jinn\Major Project\VBA Coding\latest\Monthly Tracking Channel Fake.xlsb")
Worksheets("Branch NTB AR").Select
Worksheets("Branch NTB AR").Range("A1").Select
RowCount = Worksheets("Branch NTB AR").Range("A1").CurrentRegion.Rows.Count
With Worksheets("branch NTB AT").Range("A1")
.Offset(RowCount, 0) = percentagecollected
.Offset(RowCount, 1) = noofemail
End With
monthlytransferdata.Save
End Sub
But it gives back error: Run Time error 13: Type mismatch
&
another problem it does not allow me to actually specify which column and row I want to extract my data from.