Hello all,
So I know I'm biting off more than I can chew on this one, but I love a good challange. Below is my code I have so far. What I would like to do is have a button that when pressed does the following:
opens a selectable workbook and opens a new workbook.
For this example copy D1 from the selcted workbook to the new workbook.
This is as far as I've gotten and here is the code so far that does not work.
Private Sub CommandButton1_Click()
Dim newwb As Workbook
Dim SourceWB As Workbook
Set newwb = Workbooks.Add
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Excel files", "*.xlsx; *.xlsm; *.xlsa", 1
.AllowMultiSelect = False
.Show
If .SelectedItems.Count > 0 Then
Set SourceWB = Workbooks.Open(.SelectedItems(1))
SourceWB.Sheets("Exhibit 1").Range("D1").copy_
newwb.Sheets("sheet1").Range ("d1")
Else
newwb.Close
End If
End With
End Sub
Long term, it will then save the new workbook with an input box answer and close the workbook all the data was copied from. (i'll cross that bridge when I get there).
Thanks!
Bookmarks