View Single Post
 
Old 02-26-2015, 12:56 AM
dapeamel dapeamel is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Feb 2015
Location: sweden
Posts: 10
dapeamel is on a distinguished road
Default How to return the first cell in a row?

Hi guys

I use this code but I still dont get the first cell in the same column and row 1



see code below:

Code:
Sub Langauge_Combination() 


For Each sht In ActiveWorkbook.Worksheets
Set Rng = sht.UsedRange

Set MyRange = Rng
For Each MyCol In MyRange.Columns
For Each MyCell In MyCol.Cells
'MsgBox ("Address: " & MyCell.Address & Chr(10) & "Value: " & MyCell.Value)

If MyCell.Interior.ColorIndex = 23 Then

'MsgBox MyCell.Text

' Put code here

MsgBox "" & MyCell.End(xlUp).Text 'I DONT GET THE FIRST ROW WHY?


End If
Next
Next
Next

End Sub
See example file

also picture
Reply With Quote