i have a code which was written by a freelancer on a dummy file. when i tried to copy the code into my original file, i ran into some error. i understand that the code contains a lot of .select and was advised to rewrite the code.
can anyone help me with that?
i have a table with all the companies details, including the different dates that the companies do their surveys. the surveys are done on ad hoc basis, so a company may be doing the X time survey, while some are on their first.
the vba codes above are supposed to extract all the companies who have done at least two surveys on a specific dates. if the company has done survey 2 and 3 within the specified date, then it should appear in the same row.
this is the file that the freelancer worked on with dummy data. i believe it's easier for you to understand once you see the file.
can anyone help me with that?
Code:
Sub Macro2()'' Macro2 Macro
'
'
Range("Table1[[#Headers],[SURVEY 1 DATE]]").Select
Windows("Book1.xlsx").Activate
Application.WindowState = xlNormal
Application.WindowState = xlNormal
Windows("20190322.xlsm").Activate
Columns("B:B").Select
Selection.Copy
Range("Table1[[#Headers],[COMPANY NAME]]").Select
Sheets.Add After:=ActiveSheet
Columns("A:A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Columns("A:A").EntireColumn.AutoFit
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
ActiveSheet.Range("$A$2:$A$1602").RemoveDuplicates Columns:=1, Header:=xlNo
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Delete
Sheets("Engagement Log").Select
Range("AE2").Select
Sheets("Sheet1").Select
End Sub
i have a table with all the companies details, including the different dates that the companies do their surveys. the surveys are done on ad hoc basis, so a company may be doing the X time survey, while some are on their first.
the vba codes above are supposed to extract all the companies who have done at least two surveys on a specific dates. if the company has done survey 2 and 3 within the specified date, then it should appear in the same row.
this is the file that the freelancer worked on with dummy data. i believe it's easier for you to understand once you see the file.