Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA - Transferring Information via "If - then"?

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA - Transferring Information via "If - then"?

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.
--
Regards,
Tom Ogilvy


"ktpack " wrote in message
...
I've been using Excel for years, but am fairly new at VB. I need help
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 want
to move this information to different areas of the page based on what
it says. FOr example, if it says in column A: "applied", then i want to
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 this
make sense? Can anyone help? Should I be using some sort of if-then
code?

Thanks!


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
auth data not passed to "transferring file..." dialog Paul G[_2_] Excel Programming 0 October 22nd 03 10:37 PM


All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"