Help with Macro...Never wrote one before.

  • Thread starter Thread starter Matthew Webb
  • Start date Start date
M

Matthew Webb

Hi,

I've never programed a macro before and I need a little help. I am
trying to get a macro together that will, on a change to the workbook,
go through a range of cells and take a figure (store stock) and take
forward sales from that figure until it will be a minus value and divide
the last to get a decimal precision.

e.g

store stock 100K sales going forward, 40K, 40K, 40K so cover is 2.5wks.

Is that enough info for some advise?
 
Matt

Not enough info.

How is the workbook changing that will trigger this macro? Are you entering
something? If so, what?
Do you have a list somewhere that shows the future sales? Where is it and
how is it laid out?
If the answer, in your example, is 2.5 weeks, what do you want to do with
that answer? Show it in a cell?

Just walk me through the steps if you were going to do this manually, eg.
1. Type a stock number in cell A1
2. Type a sales amount in B1
3. Find the matching stock number on Sheet2 in column A
4. Start adding weekly sales until it exceeds B1
5. Divide that sum by the amount in B1
6. Put the results in cell C1
 

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