Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get Values from 1st Row of Cells in EXCEL

Posted on 2006-11-13
1
Medium Priority
?
160 Views
Last Modified: 2010-05-18
I need the code that will do the following in EXCEL:

1) Go through the first row and get the value from each cell one at a time.
2) If the value in a cell is equal to "expected" then identify what the column is (A, B, C, etc.) and output that value (for the sake of this example just output to a msgbox).

0
Comment
Question by:CVGunx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 13

Accepted Solution

by:
rettiseert earned 800 total points
ID: 17930808
This:

    Dim cel As Range
    Dim i As Long
    Dim expected As Double
   
    expected = 1.5
   
   
    For i = 1 To 255
        Set cel = ActiveSheet.Cells(1, i)
        If cel.Value = expected Then
            MsgBox cel.Address
        End If
    Next
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question