Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi morph000
Try the following code. Press <Alt<F11, select Insert|Module and paste Option Explicit Dim iLastRow As Long Dim iText As Variant Dim iRow As Long Sub Testing() iLastRow = Cells(Rows.Count, "A").End(xlUp).Row iRow = 1 iText = InputBox("What criteria do you want to use", "Enter Criteria", vbOKCancel) For iRow = iRow To iLastRow If Range("A" & iRow).Value = iText Then With Worksheets("Sheet1") .Range("B" & iRow).Copy .Range("C" & iRow).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False .Range("B" & iRow).ClearContents End With End If Next iRow End Sub "morph000" wrote: Bit of a newbie with Excel I'm afraid, and need some help with this one. What I need to do is this (by way of example): Scan column A in a worksheet and for each cell in that column that contains "Y", move (not copy) the contents of the cell in that row but in column B to the cell in column C AND then delete the old contents of the B cell. ie if An="Y" then Cn=Bn AND Bn="" where "n" is any number. Any ideas on this welcome ! No doubt there's a fairly easy way to do it. -- morph000 ------------------------------------------------------------------------ morph000's Profile: http://www.excelforum.com/member.php...o&userid=30490 View this thread: http://www.excelforum.com/showthread...hreadid=501434 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I perform linear regression? | New Users to Excel | |||
How can perform a summation? | Excel Worksheet Functions | |||
How do I perform agreement statistics (kappa coeficient) in MS Ex. | Excel Discussion (Misc queries) | |||
Repeat Code Repetitive Actions? | Excel Discussion (Misc queries) | |||
Perform functions on the result of adding two columns | Excel Worksheet Functions |