how can i search for the first cell with the "AA1111" format (2 Alphas and 4 numbers)?
the search must be excecuted in whole cells only, firts on the "Moves" sheet
Sheets("Moves").Select
Range(StartValue).Select ' i defined the Startvalue as an adress in a previous piece of the macro
'what to put here? (this is where i want to search for a cell with the chosen format)
Temp1=ActiveCell.Value
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
ValueA=ActiveCell.Value
Sheets("Scrap").Select
Cells.Find(What:=Temp1, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
ValueB=ActiveCell.Value
Sheets("PPM").Select
Cells.Find(What:=Temp1, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
Cells.Formula = "= 1000000 /" +ValueA+"*"+ValueB ' if the "1000000/" ValueA results in the difision by zero error i want the formula to be "0" zero
any suggestions about how to shorten the code are welcome to
i hope someone will help me out
Thanks in Advance!
the search must be excecuted in whole cells only, firts on the "Moves" sheet
Sheets("Moves").Select
Range(StartValue).Select ' i defined the Startvalue as an adress in a previous piece of the macro
'what to put here? (this is where i want to search for a cell with the chosen format)
Temp1=ActiveCell.Value
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
ValueA=ActiveCell.Value
Sheets("Scrap").Select
Cells.Find(What:=Temp1, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
ValueB=ActiveCell.Value
Sheets("PPM").Select
Cells.Find(What:=Temp1, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
Rij=ActiveCell.Row
Kolom=ActiveCell.Column
Cells(Rij, Kolom+1).Select
Cells.Formula = "= 1000000 /" +ValueA+"*"+ValueB ' if the "1000000/" ValueA results in the difision by zero error i want the formula to be "0" zero
any suggestions about how to shorten the code are welcome to
i hope someone will help me out
Thanks in Advance!