VBA - Transferring Information via "If - then"?

K

ktpack

I've been using Excel for years, but am fairly new at VB. I need hel
with a macro i'm trying to create.

I have text in one column that says one of six things: applied
submitted, etc. In the column next to that, i have a number. I wan
to move this information to different areas of the page based on wha
it says. FOr example, if it says in column A: "applied", then i want t
move the info in column B to Column C. If it says in Column A
"Submitted", then i want the info in column B to Column D. Does thi
make sense? Can anyone help? Should I be using some sort of if-the
code?

Thanks
 
T

Tom Ogilvy

Dim bFnd as Boolean

do while activeCell <> ""
bFnd = False
Select Case lcase(ActiveCell.Value)
Case "applied"
ActiveCell.offset(0,2).Value = ActiveCell.Offset(0,1).Value : bFnd =
True
Case "submitted"
ActiveCell.offset(0,3).Value = ActiveCell.Offset(0,1).Value : bFnd =
True
End Select
if bFnd then ActiveCell.Offset(0,1).ClearContents
ActiveCell.offset(1,0).Select
Loop


lcase(activeCell.Value) sees the entry in ActiveCell as all lowercase, so in
the case statement, the condition should be expressed as all lower case.

Add your additional cases.
 
Top