h2 (30), c1(33)--split- c1(30) -d1(3)

  • Thread starter Thread starter sidex
  • Start date Start date
S

sidex

hi all,

i'm new here and i hoop you ppl can help me.


this is what i wand

h2 30



c1 33 --> c1 30
c2 3


i have mad this in macro


Code:
--------------------


Sub bereken()
grens = Range("H2").Value
invoer = ActiveCell.Value
If invoer > grens Then
restwaarde = invoer - grens
uitvoer = invoer - restwaarde
ActiveCell.Value = uitvoer
ActiveCell(2, 1).Value = restwaarde
End If

End Sub


--------------------



i don't like it in macro so i hoop somebody has some code that does
the same

i put a sample in the attached..

Attachment filename: test1.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=505351
 
I don 't think you can do what you want because if you put a formula in the
cell it will immediately lose it's value.

You could use worksheet event code to trap the input and update according to
your rules. Where is the input range?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
oke i think


the input range is in H2 450


if that's true ,tobad i need to use marco do this..(btw the macro i
the attached does work
 
If you use worksheet code, it will be automatic, no button pushing.

I understand that H2 is where the comparison value is, but which cells are
the active cells when you click the button. This is where the worksheet
event code would apply.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
a oke. well i'm very noob in this . i'm sorry for that. but could yo
give a sample of a code..

yeah i didn't but a range a cell, becaurs every cell you can use this
you could say every cell is an active cell
 

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