I have a code to open a file on a shared drive. I am able to copy and paste the contents of a worksheet, however I would like to paste special with formatting and values. Additionally, the copied material is grouped and I would like to paste it ungrouped. Here is the code I have thus far:
Sub PullFromFile()
Dim wkb As Workbook, wkbFrom As Workbook
Dim fromPath As String
' Get path from cell B2 on Filepath tab.
fromPath = Sheets("Filepath").Range("B2")
Set wkb = ThisWorkbook
Set wkbFrom = Workbooks.Open(fromPath)
' Copy from specific worksheet
Dim wks As Worksheet
Set wks = wkbFrom.Sheets("RBM")
Dim rng As Range
Set rng = wks.Rows("1:10000")
rng.Copy wkb.Sheets("Data").Range("A1")
wkbFrom.Close False
End Sub
Sub PullFromFile()
Dim wkb As Workbook, wkbFrom As Workbook
Dim fromPath As String
' Get path from cell B2 on Filepath tab.
fromPath = Sheets("Filepath").Range("B2")
Set wkb = ThisWorkbook
Set wkbFrom = Workbooks.Open(fromPath)
' Copy from specific worksheet
Dim wks As Worksheet
Set wks = wkbFrom.Sheets("RBM")
Dim rng As Range
Set rng = wks.Rows("1:10000")
rng.Copy wkb.Sheets("Data").Range("A1")
wkbFrom.Close False
End Sub