copying text into a macro

P

pagelocator

I was trying to write a macro in which I was copying a selection from
combo box into a second macro which would then be run under instructio
from the first macro. However the second macro wouldn't allow me to cop
in text. Effectively what I am building is a very simple search engine
searching a column, but I don't want to use Auto filter or custo
filter, I want a macro to take care of it all so that the user just ha
one button to click on, after making a selection in the combo box.

2nd problem. I have some control buttons, and they change size, eve
though I have auto formatted them not to in properties. An
suggestions
 
H

Harald Staff

Hi

You pass text from one macro to another like this:

Sub MainMan()
Dim S As String
S = ComboBox1.Text
Call SlaveMan(S)
End Sub

Sub SlaveMan(S As String)
MsgBox "Action here using text " & S
End Sub

HTH. Best wishes Harald
 

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

Top