Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default select column, cut and paste it to new worksheet

Hello

I am looking to select a column by a text word at the top of the column. I
would like the macro to find the word, select it and the data below it (until
the cells are blank) and copy this column into another column on worksheet2
of the same workbook.
The data in worksheet1 is roughly 15 columns by 20 rows (can vary), the cell
text will be items such as; End Bal. ledger, End Price, Client Name etc

I am unsure of how to find the text words and select a column in a row. The
position of the text along the row will change each time. Does anyone know
how this can be done? Thank you in advance for any info..

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default select column, cut and paste it to new worksheet

Your below descriptions contradict each other. However try the below macro

select a column by a text word at the ** top ** of the column.
The position of the text along the row ** will change ** each time.


Sub Macro()

Dim varFound As Variant, strSearch As String
strSearch = "texttofind"

Set varFound = Sheets("Sheet1").Cells.Find(strSearch)
If Not varFound Is Nothing Then
Columns(varFound.Column).Copy Sheets("Sheet2").Range("A1")
Columns(varFound.Column).ClearContents
End If

End Sub
If this post helps click Yes
---------------
Jacob Skaria


"Withnails" wrote:

Hello

I am looking to select a column by a text word at the top of the column. I
would like the macro to find the word, select it and the data below it (until
the cells are blank) and copy this column into another column on worksheet2
of the same workbook.
The data in worksheet1 is roughly 15 columns by 20 rows (can vary), the cell
text will be items such as; End Bal. ledger, End Price, Client Name etc

I am unsure of how to find the text words and select a column in a row. The
position of the text along the row will change each time. Does anyone know
how this can be done? Thank you in advance for any info..

Reply
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
VB help SELECT COLUMN / PASTE FORMULA'S XLtest Excel Discussion (Misc queries) 0 January 23rd 10 12:14 PM
Cannot paste column data from one worksheet to another stevemalee[_2_] Excel Worksheet Functions 2 August 30th 09 09:53 PM
Select rows with certain values, cut, paste into new worksheet Meltad Excel Programming 11 August 7th 06 09:58 AM
Select empty column & paste - Help please saziz[_50_] Excel Programming 6 December 20th 05 06:48 PM
Select an array of cells and paste to separate worksheet - 2nd post - 1st didn't work!! Lee Wold[_2_] Excel Programming 1 February 10th 04 03:22 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"