Tanda Badal
New Member
- Joined
- Oct 24, 2002
- Messages
- 8
Hi
I have the following two macro coneccted (123456 is a form title). and I am trying to fill three cell in a row and than go to next row and repeat but with new data. When pressing on vbOK, I would like to cursor to go to TxtBORG. And when vbCancel it terminate the Macro. At the moment I have to presess the Cancel bottom quite few times before it will terminate the macro.
Please can you look at this and tell me how I can achieve this.
Many thanks for you help. Please see below for the Macro.
Sub Testing31Oct2002()
With 123456
.txtBORG = ""
.TxtNominal = ""
Formula = "=VLOOKUP(" & (ActiveCell.Address) & ",'Full Client List'!B5:C3049,2,0)"
.Show
If .Tag = vbCancel Then Exit Sub
If .Tag = vbOK Then
ActiveCell = .txtBORG
ActiveCell.Offset(0, 1).Select
ActiveCell = Formula
ActiveCell.Offset(0, 1).Select
ActiveCell = .TxtNominal
ActiveCell.Offset(1, -2).Select
Exit Sub
End If
End With
End Sub
----------------
Sub Bismillah()
[a10].Select
If vbCancel Then EndBismillah
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
End Sub
------------
I have the following two macro coneccted (123456 is a form title). and I am trying to fill three cell in a row and than go to next row and repeat but with new data. When pressing on vbOK, I would like to cursor to go to TxtBORG. And when vbCancel it terminate the Macro. At the moment I have to presess the Cancel bottom quite few times before it will terminate the macro.
Please can you look at this and tell me how I can achieve this.
Many thanks for you help. Please see below for the Macro.
Sub Testing31Oct2002()
With 123456
.txtBORG = ""
.TxtNominal = ""
Formula = "=VLOOKUP(" & (ActiveCell.Address) & ",'Full Client List'!B5:C3049,2,0)"
.Show
If .Tag = vbCancel Then Exit Sub
If .Tag = vbOK Then
ActiveCell = .txtBORG
ActiveCell.Offset(0, 1).Select
ActiveCell = Formula
ActiveCell.Offset(0, 1).Select
ActiveCell = .TxtNominal
ActiveCell.Offset(1, -2).Select
Exit Sub
End If
End With
End Sub
----------------
Sub Bismillah()
[a10].Select
If vbCancel Then EndBismillah
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
Testing31Oct2002
End Sub
------------