Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

Get Values from 1st Row of Cells in EXCEL

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
CVGunx
Asked:
CVGunx
1 Solution
 
rettiseertCommented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now