Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-10-2012, 02:05 AM
macropod's Avatar
macropod macropod is offline VBA column header vs first row text Windows 7 64bit VBA column header vs first row text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could try something along the lines of:
Code:
Sub Demo()
Dim LastCol As Long, i As Long
With ActiveSheet
  LastCol = .Cells.SpecialCells(xlCellTypeLastCell).Column
  For i = 1 To LastCol
    If .Cells(1, i).Value = "Price" Then Exit For
  Next
  MsgBox Split(.Cells(1, i).Address, "$")(1)
End With
End Sub
Of course, you don't actually need the column letter(s) to work with the column. Having found the column number, you can work with that. For example, if you want a value from the 10th row in the found column, you could use:
.Cells(10, i).Value
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two column format without affecting neither the page numbers nor the header or footer Jamal NUMAN Word 4 02-21-2012 03:20 PM
VBA column header vs first row text Aligning column text in a table dpeattie Word 6 12-29-2010 04:59 PM
adding text on a separated column line ahmet1985 Word 0 03-27-2010 07:10 AM
VBA column header vs first row text 2-Column Text Slides and Aligning Bullets KitKatJM PowerPoint 1 03-09-2010 06:45 PM
Lost Column header Policy Peddler Outlook 1 06-05-2009 07:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft