Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a column name
Gooday all,
I currently have some names in various columns but on the same same row. I have at the moment been able to search for a name in the column. But as I dont know the actual cell how can I find the cell name? example names are in D12, E12 .... P12 they are all on row 12 but I dont know the column. the search looks at each column untill it finds a match, if it gets to an empty cell on row 12 the search ends, if it find the cell I need to delete the column. Taking into acount that P12 may go as far as FF12!! I dont actualy know. Does this make sense? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a column name
see if this example will get you started:
Sub Find_Item() Dim rngfound As Range Dim lastrow As Long Dim ws As Worksheet Set ws = Worksheets("Items") lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row itmToFind = "Test" With ws.Range("A12:ff12") Set rngfound = .Find(itmToFind, LookIn:=xlValues, lookat:=xlWhole) End With If Not rngfound Is Nothing Then rngfound.EntireColumn.Delete End If End Sub -- Gary "Squirrel-Salad" wrote in message 6.253... Gooday all, I currently have some names in various columns but on the same same row. I have at the moment been able to search for a name in the column. But as I dont know the actual cell how can I find the cell name? example names are in D12, E12 .... P12 they are all on row 12 but I dont know the column. the search looks at each column untill it finds a match, if it gets to an empty cell on row 12 the search ends, if it find the cell I need to delete the column. Taking into acount that P12 may go as far as FF12!! I dont actualy know. Does this make sense? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Finding a column name
see response to your posting in newusers
-- Regards Roger Govier "Squirrel-Salad" wrote in message 6.253... Gooday all, I currently have some names in various columns but on the same same row. I have at the moment been able to search for a name in the column. But as I dont know the actual cell how can I find the cell name? example names are in D12, E12 .... P12 they are all on row 12 but I dont know the column. the search looks at each column untill it finds a match, if it gets to an empty cell on row 12 the search ends, if it find the cell I need to delete the column. Taking into acount that P12 may go as far as FF12!! I dont actualy know. Does this make sense? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
finding the largest value for a name in a column and then returningthe result from a different column | Excel Worksheet Functions | |||
Finding the closest number in column A and take the value in column B | Excel Worksheet Functions | |||
Finding all matches in column B with datalist in column A | Excel Programming | |||
Output from a userform finding the right column. column | Excel Programming | |||
finding and reporting in column A, where a series of column reaches zero | Excel Programming |