steve400243
Active Member
- Joined
- Sep 15, 2016
- Messages
- 429
- Office Version
- 365
- 2016
- Platform
- Windows
Hello, thanks for any help that can be provided.
I use this msgbox code to run macro"t" when a user opens the workbook. After this is complete, I want another macro to run automatically without the select button.
the other macro to autorun is "getuniques" and is in module2
I use this msgbox code to run macro"t" when a user opens the workbook. After this is complete, I want another macro to run automatically without the select button.
VBA Code:
Private Sub Workbook_Open()
If MsgBox("Hello, Would you like to Create a new report?", vbYesNo, "CFS DATA ANALYSIS REPORT") = vbYes Then Call t
End Sub
the other macro to autorun is "getuniques" and is in module2
Code:
Sub getuniques()
Dim d As Object, c As Variant, i As Long, lr As Long
Set d = CreateObject("Scripting.Dictionary")
lr = Cells(Rows.Count, 1).End(xlUp).Row
c = Sheets("Sheet1").Range("A2:A500" & lr).Value2
For i = 1 To UBound(c, 1)
If c(i, 1) <> "" Then d(c(i, 1)) = Empty
Next i
Sheets("ANALYSIS").Range("U3").Resize(d.Count) = Application.Transpose(d.Keys)
End Sub