Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for your help.
I found the reply from FTs1 a bit easier to follow and will probably go with that one. Cheers. "Dave Peterson" wrote: You could use the same thing as Edit|Find in code: Dim FoundCell as range Dim WhatToFind as String whattofind = "ABS" With someworksheetvariablehere Set FoundCell = .Cells.Find(What:=whattofind, _ after:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ lookat:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) end with if foundcell is nothing then msgbox "not found else msgbox foundcell.address & vblf & foundcell.row & vblf & foundcell.column end if If you know it's in row 1, you could be more specific: With someworksheetvariablehere with .rows(1) Set FoundCell = .Cells.Find(What:=whattofind, _ after:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ lookat:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) end with end with ..... Marco wrote: I am searching in a table for a specific heading, for example ABS. Now as I am receiving this information from a 3rd party, that ABS could be in column 10 on one file, but in column 54 in the next. I would like to retreive the column number of that heading, store it within the macro to use for sorting and other funtions I am creating. How can I get just the column, or just the row, or both if I need it. The address function is what I would use in Excel. Thanks. -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
invalid reference error saving 2003 file in 2007 | Excel Discussion (Misc queries) | |||
Saving data from a cell reference | Excel Discussion (Misc queries) | |||
How do I save Excel info without saving the reference cells? | Excel Discussion (Misc queries) | |||
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |