Column Selection

PSK9784

New Member
Joined
May 21, 2008
Messages
15
I need to search through a given cell range of coulmns to find a particular name, whenever that name is found, I need to copy all the cells located in that column below the name to a different location...

<STYLE type=text/css>body { margin: 0 0 0 0; padding:0 0 0 0 }td,div { font-family:Tahoma;font-size:8pt;vertical-align:top }body { margin: 0 0 0 0; padding:0 0 0 0 }.transcript { background-color:#d2d2d2; }.messageBlock { margin-left:4px; margin-bottom:3px }.message { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre; }.messageCont { margin-left:100px; word-wrap:break-word; white-space:-moz-pre-wrap; _white-space:pre;}.other { color:#39577a;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.myself { color:#da8103;font-style:normal;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont { font-size:8px;text-align:right; color:#39577a;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.myselfCont { font-size:8px;text-align:right; color:#da8103;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.system { margin-left:4px; word-wrap:break-word;color:#da8103;font-style:normal;font-weight:normal; white-space:-moz-pre-wrap; _white-space:pre; }.showTimestamp { margin-right:3px; float:right; color:#999999;font-style:normal;font-weight:normal; }.other1 { color:#ac2000;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont1 { font-size:8px;text-align:right; color:#ac2000;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other2 { color:#3c9fa8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont2 { font-size:8px;text-align:right; color:#3c9fa8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other3 { color:#e25614;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont3 { font-size:8px;text-align:right; color:#e25614;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other4 { color:#0b6ac8;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont4 { font-size:8px;text-align:right; color:#0b6ac8;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other5 { color:#b23290;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont5 { font-size:8px;text-align:right; color:#b23290;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other6 { color:#02e7c7;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont6 { font-size:8px;text-align:right; color:#02e7c7;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.other7 { color:#5b3284;vertical-align:top;font-weight:bold;font-style:normal;float:left; width:95px; }.otherCont7 { font-size:8px;text-align:right; color:#5b3284;font-family:Arial,Lucida Grande;font-style:normal;vertical-align:top;font-weight:bold;float:left; width:95px; }.tsDisplay { display:block }</STYLE> <TABLE width=500>f Range("A1:G1") = "Justine" Then
Range("THAT COLUMN").Select
Selection.Copy
Range("C20").Select
ActiveSheet.Paste
End If<TBODY></TBODY></TABLE>

Any Ideas?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to the board...

See if this works

Code:
x = Application.match("Justine",Range("A1:G1"),0)
If Not Iserror(x) Then
    y = Cells(Rows.Count,x).End(xlup).row
    Range(Cells(1,x),Cells(y,x)).Copy Range("C20")
End If

Hope this helps...
 
Upvote 0
Try (although Jonmo1's looks better than mine!!):

Sub FindJustine()

Columns("A:B").Select

For Each cell In Selection
If cell.Value = "Justine" Then
cell.Select
Range(cell, Selection.End(xlDown)).Copy
Range("C20").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If
Next

End Sub
 
Upvote 0
Both of those technically helped... I supposed I didn't explain well-enough what exactly it is that I need done... here is an example..
Justine Tom Justine Mark Tom
Books 5 4 5
Light Bulbs 2 3 1
Pencils 7 6 8
Pens 2 2 2
Paper
Ink Cartridge


etc.

If you get what I'm saying, we had to put a survey out and this is how it came back, people's names were listed in different columns rather than just one column with all of their entries. I need everyone's entries to be put into one column. This would seem easy to do manually but this is only a small example this survey is pages and pages of entries. I hope I explained it a little better, we're on the right track though!

Thanks for the help everyone!
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top