PDA

View Full Version : Data manipulation



ajkiwi88
06-13-2013, 04:02 AM
what im trying to do is i have a value stored in A which can be either a full number (like 1) or a part number (like 1.1) if the number is a full number i want to take the value stored in col E and store in in a variable. If its a part number i want to take the value previously stored in the variable and multiply by the number in coll E and then place the result in coll F.

this is where im up to but it seems to do nothing :banghead: any help will be appreciated
Sub Button1()
Count = 2
Do
If (Int(Acount) = Acount) Then
tempvalue = Ecount
Else
Fcount = Ecount * tempvalue
End If
Count = Count + 1
Exit Do
Loop While Acount <> " "
End Sub

Cheers
Andy

SamT
06-13-2013, 06:14 AM
what im trying to do is i have a value stored in A which can be either a full number (like 1) or a part number (like 1.1) if the number is a full number i want to take the value stored in col E and store in in a variable. If its a part number i want to take the value previously stored in the variable and multiply by the number in coll E and then place the result in coll F.

this is where im up to but it seems to do nothing :banghead: any help will be appreciated
Sub Button1()
Count = 2
Do
If (Int(Acount) = Acount) Then
tempvalue = Ecount
Else
Fcount = Ecount * tempvalue
End If
Count = Count + 1
Exit Do
Loop While Acount <> " "
End Sub

Cheers
Andy

I hope that is not really your code. If it is, you need to put "Option Explicit" as the very first line on the code page, then correct all the errors that shows you.

If it's not the actual code, you need to post the actual code for us to see.

BTW, that "Exit Do" means the code will never loop. The "Exit Do" will make it jump out of the loop the first time the CPU sees it.