Input Box

  • Thread starter Thread starter h0l1yw0od
  • Start date Start date
H

h0l1yw0od

Hi everyone,

Could someone help me with the code for an input box please.

I've got it to display the box but i need to put in the code that wil
send the input data to a cell on another page and add it to the figur
already there.

The code i have so far is:

---
Dim NumberOfItems As Integer
NumberOfItems = InputBox("How many items were in the batch?", "Ente
Amount.")
---

The macro needs to look at cell C4 to see the name of the employee an
then find the appropriate worksheet and enter the contents of the inpu
box in to cell A57 on that sheet.

I've been looking at this for a few days and i've not been able t
figure it out yet. Any help would be useful. :confused:

Thanks
 
You didn't really make it very clear but try
sheets("othersheet").range("a57")=inputbox(etc
 
Sounds like you need

Worksheets(Range("C4").Value).Range("A57").Value = NumberOfItems

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi again,

I've been fiddling with this as i've just noticed that i didn't explain
properly that the contents of the Input box need to be added to the
contents of cell A57 that are already there.

From your answer of:

Worksheets(Range("C4").Value).Range("A57").Value = NumberOfItems

I have tried adding ...Value = range("A57") + NumberOfItems and various
combinations of A57 + NumberOfItems but i just can't seem to find the
correct phrasing for it.

This works perfectly except for this one small detail. :cool:

It would also be helpful if you could just explain how the code you've
already given works as i can't see how it applies the worksheet name to
the word 'range' or 'value'.

Sorry if this all sounds stupid, i'm still trying to get to grips with
VB! :confused:

Thanks again.
 

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