LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Check column header value

I apologize for the unclear question. I am looking for the first option in
your reply. Thanks Dave!

choo

"Dave Peterson" wrote:

This checks each field and will "run" the "do A" twice if both are found.

With worksheets("somesheetnamehere")
if lcase(.range("j1").value) = lcase("Product_Name") then
msgbox "do A"
end if
if lcase(.range("ac1").value) = lcase("Price") then
msgbox "do A"
end if
end with

or maybe you meant to check both headers and if either is ok, then do A???

With worksheets("somesheetnamehere")
if lcase(.range("j1").value) = lcase("Product_Name") _
or lcase(.range("ac1").value) = lcase("Price") then
msgbox "do A"
end if
end with

or maybe you meant to check both headers and if both are ok, then do A???

With worksheets("somesheetnamehere")
if lcase(.range("j1").value) = lcase("Product_Name") _
And lcase(.range("ac1").value) = lcase("Price") then
msgbox "do A"
end if
end with




choo wrote:

Hi,
I would like to verify the value of certain column header. How does the
code looks like?

eg.
check, if column J = "Product_Name", do A, else stop.
if column AC = "Price", do A, else stop.

Thank you.

choo


--

Dave Peterson
.

 
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
Return column number from column header text Roger[_3_] Excel Discussion (Misc queries) 4 February 14th 08 09:40 PM
rename column header after filtering column results in the MS SQL Neall Excel Programming 1 December 3rd 07 09:05 PM
Loop through column(s) to check values, perform action based on check ward376 Excel Programming 4 November 6th 07 03:21 PM
Get Intersection value given column header and row header Scorcel Excel Discussion (Misc queries) 1 June 6th 07 08:24 AM
Search for a column based on the column header and then past data from it to another column in another workbook minkokiss Excel Programming 2 April 5th 07 01:12 AM


All times are GMT +1. The time now is 06:42 PM.

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

About Us

"It's about Microsoft Excel"