Retrieving columns with data

dwhite

Registered User.
Local time
Today, 21:51
Joined
Dec 26, 2000
Messages
13
I have a spreadsheet that has 133 columns that represent categories. On the row side I have about 1700 project numbers. Each project will use up to 14 of the 133 columns. The columns that are used with a project will have a cell labeled with a number 1. Example below:

Project No. Column B Column C Column D Column E.....Column DD
12345 1 1 1

What I need to do is find a function where I can retrieve "BCE" to indicate where data is stored in that row. I am looking for unique patterns and am using the column letters as a base. So I would really appreciate if anyone has any input. Thanks much.

Dick White
Colorado Springs, CO
 
I'd love to help you but before I can, I'd like you to do me a favor.

Please forget everything you know about the project you're working on and read your post and tell me if you think it makes sense to somebody who has no clue what you're doing. I think that will help you get an answer. If not, see the links in my siggy.
 
Try:

Code:
public function blah(lngRow as long) as string

dim rng as range
dim strCol as string

for each rng in workbooks("workbookName").worksheets("SheetName").rows(lngRow)
if rng.value = 1 then
   strCol = strCol & left(rng.address(columabsolute:=false))
end if
next rng

blah = strCol
end function
 

Users who are viewing this thread

Back
Top Bottom