Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VB help SELECT COLUMN / PASTE FORMULA'S | Excel Discussion (Misc queries) | |||
Cannot paste column data from one worksheet to another | Excel Worksheet Functions | |||
Select rows with certain values, cut, paste into new worksheet | Excel Programming | |||
Select empty column & paste - Help please | Excel Programming | |||
Select an array of cells and paste to separate worksheet - 2nd post - 1st didn't work!! | Excel Programming |