View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
wdjsxj wdjsxj is offline
external usenet poster
 
Posts: 4
Default Automatically changing cell information

hi, i am new VBA learner , i write a VBA for your case.
you can insert it as the Command button code. Please try. and i welcome
experts opinions on it.

if you have data in column A and you want the result in column B, then,

Private Sub CommandButton1_Click()
lastrow = Range("a65536").End(xlUp).Row
For i = 1 To lastrow
tempv = Cells(i, 1).Value
If Right(tempv, 2) = "CR" Then
Cells(i, 2).Value = "-" & Left(tempv, Len(tempv) - 2)
Else: Cells(i, 2).Value = Cells(i, 1).Value
End If
Next i
End Sub


€œBBurz€ç¼–写:


Hey all,

Ive tried to figure out this problem myself, but I just dont know where
to look. Heres my problem:

Everyday I generate a report that shows debits and credits. Any credits
are shown as a '50.00CR', where as debits are shown as '50.00'. I am
wondering if it is possible to change the formatting so any cell shown
as '50.00CR' is changed to '-50.00' something of that nature. As of now
its a few thousand entries everyday and can take up to 20-30 minutes of
going through the lines and manually changing them.

Any solution is viable, I just need something so when I select the
column with all of these values and run a sum(), excel picks up that
the 50.00CR are indeed, negative values in the equation.

Thanks for any help with this problem.


--
BBurz
------------------------------------------------------------------------
BBurz's Profile: http://www.excelforum.com/member.php...o&userid=36269
View this thread: http://www.excelforum.com/showthread...hreadid=560551