ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Hi,
Struggling with this.
I have the code in use below but it fails when i try to open the new workbook.
Do you see why please
Struggling with this.
I have the code in use below but it fails when i try to open the new workbook.
Do you see why please
Rich (BB code):
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim c As Range
Dim ans As String
Dim Lastrow As Long
ans = ActiveCell.Value
Workbooks.Open Filename:="C:\Users\Ian\Desktop\REMOTES ETC\DR\DR.xlsm"
Worksheets("POSTAGE").Activate
Lastrow = Sheets("Sheet13").Cells(Rows.Count, "B").End(xlUp).Row
For Each c In Sheets("Sheet13").Range("B1:B" & Lastrow)
If c.Value = ans Then Application.Goto Reference:=Sheets("Sheet13").Range(c.Address): Exit Sub
Next
Application.ScreenUpdating = True
End Sub