macro button initiation

  • Thread starter Thread starter NewToVB
  • Start date Start date
N

NewToVB

I'm using visual studio, writing in visual basic (it's basically the same
thing as VBA) and I'm opening up an excel sheet that has a button in it with
a macro assigned to the button. I need to to initiate the button click even
from my code after I've opened up the excel sheet. Any ideas on how to do
this?
 
If the button macro is something like:

Sub Button1_Click()
Range("D6").Select
ActiveCell.FormulaR1C1 = "1"
Range("D7").Select
End Sub

then your code could:

Application.Run "Book1!Button1_Click"
 
Perfect! Thanks a billion!

Gary''s Student said:
If the button macro is something like:

Sub Button1_Click()
Range("D6").Select
ActiveCell.FormulaR1C1 = "1"
Range("D7").Select
End Sub

then your code could:

Application.Run "Book1!Button1_Click"
 

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