input box = formula bar

D

David494

Hey

I'm quite new to this VBAing in Access and I'm having a bit of
problem here.

I have coding which allows an input box to appear when a button i
pressed......

Dim varInput As String

varInput = InputBox("Select your cell?")


First I would like the user to click on a cell to populate the formul
bar with the text they want to search for. Then they click on th
button and the input box pops up. However I want the input box to b
populated with the text from the formula bar.

Is this at all possible?

Cheers

Dav
 
G

Guest

hi,
I'm having a little trouble understanding why you would want to do it that
way.
you can get your variable from the sheet.

dim varinput as string
varInput = Range("A1").value

IF the user types in a value in a cell(which populates the fomula bar), the
input box becomes unneccessary.

but if you want to put the user's input on the sheet from the input box do
this

Dim varInput As String
varInput = InputBox("input something?")
Range("A1").value = varinput.value

this will populate cell A1 (and the formula bar) then you can use the use's
input into the inputbox for the rest of your macro.
Remember, the formula bar just displays the contents of the activecell.
techniquely there is no data in the formual bar. it displays a formula as
written (or data if no formula) while the sheet display the product of the
formula (or just data if no formula).

regards

FSt1
 

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