Hi all, below is just some of the code I'm working with. There is a lot in between but essentially I need to utilize the Sourcewb in a SumIfs formula but can't seem to make it work. The Sourcewb will already be open and will be closed when this formula is complete. Any help is appreciated!
VBA Code:
Sub Macro12()
Application.ScreenUpdating = False
Dim Sourcewb As Workbook
MsgBox "Please select Adjustments file", vbOKOnly
Dim Dbox As FileDialog
Dim File_Path As String
Set Dbox = Application.FileDialog(msoFileDialogFilePicker)
Dbox.Title = "Choose and Open" & FileType
Dbox.Filters.Clear
Dbox.Show
If Dbox.SelectedItems.count = 1 Then File_Path = Dbox.SelectedItems(1)
Set Sourcewb = Workbooks.Open(Filename:=File_Path)
ActiveCell.FormulaR1C1 = "=SUMIFS('[" & Sourcewb.Name & "]'!C12,'[" & Sourcewb.Name & "]'!C1,RC[-2],'[" & Sourcewb.Name & "]'!C4,RC[-1])"
Application.ScreenUpdating = True