I'm a super noob at Excel VBA. I have a simple button macro and I have another macro with only two lines for copying cell values. I'm trying to combine the two macros but the two lines at the end for copying cell values don't work. Any help on how to get it to work is greatly appreciated!!
VBA Code:
Sub ButtonC_Click()
Dim MyCell As Range
Set MyCell = Sheets("Batch Input").Range("C32")
If Dir(ThisWorkbook.Path & "\" & MyCell.Value & ".xls") <> "" Then
On Error Resume Next: Err.Clear: Dim wb As Workbook
Set wb = Workbooks(MyCell.Value & ".xls"): wb.Activate
If Err.Number > 0 Then Set wb = Workbooks.Open(ThisWorkbook.Path & "\" & MyCell.Value & ".xls")
If Not wb Is Nothing Then wb.Worksheets("Shear Wall Analysis").Activate Else MsgBox "File not found", vbInformation
Else
FileCopy ThisWorkbook.Path & "\Wood Shear Wall Template.xls", ThisWorkbook.Path & "\" & MyCell.Value & ".xls"
Workbooks.Open Filename:=ThisWorkbook.Path & "\" & MyCell.Value & ".xls"
End If
Range("C67").Value = Range("C90").Value
Range("C68").Value = Range("C91").Value
End Sub