View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Moving scattered cell data to new column?

The following is just an example that you can adapt for your needs. It
assumes that column K is the destination column. It scans, row-by-row,
columns A thru J looking for cells starting with PIN. IF a cell is found, it
is moved to colum K

Sub pin_master()
Set r = ActiveSheet.UsedRange
n = r.Rows.Count + r.Row - 1
For i = 1 To n
For j = 1 To 10
If Left(Cells(i, j).Value, 3) = "PIN" Then
Cells(i, j).Copy Cells(i, "K")
Cells(i, j).Clear
End If
Next
Next
End Sub

--
Gary''s Student - gsnu200755


"LarryW" wrote:

What I have is scattered data fields on a worksheet that are not organized
into one column. There is one common entry into every field but the rest of
the information is in numbers. Example: "PIN 012345" (Pin is in every cell,
but the numbers in every cell are not the same).

I want to move all found PIN data to a new column. Example: Cell rows 1
thru 40,000 all have the PIN entry, but in different columns. I need to
"Shift/Move" all the PIN data to a new column (without multiple commands for
each individual row of data).

Help anyone :-(

--
LarryW