LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default IF value = "DEC" or "MAR" cut and paste 3 cells

Great, thanks for the feedback
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"aileen" wrote in message
...
Thanks so much. It worked perfectly with one minor adjustment.

"Bernard Liengme" wrote:

this seems to work
Sub tryme()
Application.ScreenUpdating = False
mylast = Cells(Cells.Rows.Count, "B").End(xlUp).Row
For j = 1 To mylast
'DEC, MAR, JUN, or SEP
If Cells(j, "B") = "DEC" Or Cells(j, "B") = "MAR" Or _
Cells(j, "B") = "JUN" Or Cells(j, "B") = "SEP" Then
Cells(j, "F") = Cells(j, "E")
Cells(j, "E") = Cells(j, "D")
Cells(j, "C") = Cells(j, "B")
Cells(j, "B") = ""
End If
Next j
Application.ScreenUpdating = True
End Sub

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"aileen" wrote in message
...
I need to search column B and if I find DEC, MAR, JUN, or SEP I need to
cut
the cells from that row in column B, C and D and paste them in C, D and
E.
e.g.

Column B C D E
PUT MAR 9 SP
CALL DEC 8 IND
DEC 8 SP 500
CALL JAN 9 IND
MAR 9 SP 500

After running macro, should line up as below:
Column B C D E
PUT MAR 9 SP
CALL DEC 8 IND
DEC 8 SP
CALL JAN 9 IND
MAR 9 SP

Any help is greatly appreciated. Thanks






 
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
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
What is Error "Method "Paste" of object "_Worksheet" failed? vat Excel Programming 7 February 17th 06 08:05 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 05:19 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"