LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default If statement to move data from one column to another

Sub Move_Stuff()
Dim topCel As Range
Dim bottomCel As Range
whatval = InputBox("Enter a Value")

Set topCel = Range("A1")
Set bottomCel = Cells((65536), topCel.Column).End(xlUp)
If bottomCel.Row = topCel.Row Then
With Range(topCel, bottomCel)
Set c = .Find(whatval, LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
Do
c.Cut Destination:=c.Offset(0, 1)
Set c = .FindNext
Loop While Not c Is Nothing
End If
End With
End If

End Sub


Gord Dibben MS Excel MVP

On 20 Jan 2007 12:27:57 -0800, "tmeakin" wrote:

how could you automate this so it would check each cell in column a and
move data to column b based on =if
John Bundy (remove) wrote:
you could do it with code or a function, function would be easiest, in B1 type
=IF(A1="frog",A1,"")

replace frog with whatever you are looking for or another cell, copy all the
way to the bottom of the column
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"tmeakin" wrote:

Hi,
I am a new user to excel. I am interested in a macro or vba code to
look through column a for specific data and if it finds it move it to
column b. any help would be greatly appreicated.



 
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
Using an "If" statement to move data from one column to another Jbm Excel Discussion (Misc queries) 8 July 27th 09 07:14 PM
move column data based on value of another column [email protected] Excel Programming 0 January 8th 07 04:05 PM
how to move the cursor to column A after entering data column F tskaiser New Users to Excel 2 April 29th 06 02:28 PM
How do I set up an if statement to move to next column each time Needtoknow Excel Programming 7 August 25th 05 05:44 PM
create macro to move label type data to column data JonathonWood9 Excel Programming 4 February 21st 05 10:53 PM


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