Who can join these two VBA Codes together?

  • Thread starter Thread starter Bob Vance
  • Start date Start date
B

Bob Vance

--
Sub ClickFirst()
With ActiveSheet.Buttons(Application.Caller).TopLeftCell
If .Column > 8 Then Cells(.Row - 6, .Column - 8).Select
End With
End Sub

Sub BotWorm()


With ActiveCell.Offset(1, 0).End(xlDown).Offset(1, 0)
.Value = Format(Date, "d mmm ")
.Offset(0, 1).Value = "VETERINARY CARE / BOT & WORM DRENCH"
.Offset(0, 7).Value = "30.00"
End With


End Sub



Thanks in advance.........Bob Vance
 
Sub ClickFirst()
With ActiveSheet.Buttons(Application.Caller).TopLeftCell
If .Column > 8 Then
With Cells(.Row - 6, .Column - 8).
With .Offset(1, 0).End(xlDown).Offset(1, 0)
.Value = Format(Date, "d mmm ")
.Offset(0, 1).Value = "VETERINARY CARE / BOT & WORM
DRENCH"
.Offset(0, 7).Value = "30.00"
End With
End With
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Tom Urtis wrote this and it works :))
Sub Test3()
With ActiveSheet.Buttons(Application.Caller).TopLeftCell
Dim MyRow As Long, MyCol As Integer
If .Column > 8 And .Row > 8 Then
MyRow = .Row - 8
MyCol = .Column - 8
With Cells(MyRow, MyCol).End(xlDown).Offset(1, 0)
..Value = Format(Date, "d mmm ")
..Offset(0, 1).Value = "VETERINARY CARE / BOT & WORM DRENCH"
With .Offset(0, 7)
..Value = 30
..NumberFormat = "#,##0.00"
End With
End With
End If
End With
End Sub
_________________
Tom Urtis
 
remove the dot at the end.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top