ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with an offset (https://www.excelbanter.com/excel-programming/368654-problem-offset.html)

floep[_8_]

Problem with an offset
 

Hi Guys,

I get an error for 'countc = cell.Offset(0, 5).Value' when I run thi
code. Somebody knows what could be the problem ?

With Worksheets("Mechanismen volgens object")
Set rng = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

For Each cell In rng
countc = cell.Offset(0, 5).Value
If cell.Offset(0, 2).Value = "x" Then
s = s & countc & cell.Value & Chr(10)
End If
Nex


--
floe
-----------------------------------------------------------------------
floep's Profile: http://www.excelforum.com/member.php...fo&userid=3685
View this thread: http://www.excelforum.com/showthread.php?threadid=56599


Die_Another_Day

Problem with an offset
 
what error are you getting?

Die_Another_Day
floep wrote:
Hi Guys,

I get an error for 'countc = cell.Offset(0, 5).Value' when I run this
code. Somebody knows what could be the problem ?

With Worksheets("Mechanismen volgens object")
Set rng = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

For Each cell In rng
countc = cell.Offset(0, 5).Value
If cell.Offset(0, 2).Value = "x" Then
s = s & countc & cell.Value & Chr(10)
End If
Next



--
floep
------------------------------------------------------------------------
floep's Profile: http://www.excelforum.com/member.php...o&userid=36853
View this thread: http://www.excelforum.com/showthread...hreadid=565995



floep[_11_]

Problem with an offset
 

"Type mismatch"


--
floep
------------------------------------------------------------------------
floep's Profile: http://www.excelforum.com/member.php...o&userid=36853
View this thread: http://www.excelforum.com/showthread...hreadid=565995


Tom Ogilvy

Problem with an offset
 
try this

Dim countc as String

.. . .

countc = cell.Offset(0, 5).Text

--
Regards,
Tom Ogilvy


"floep" wrote:


Hi Guys,

I get an error for 'countc = cell.Offset(0, 5).Value' when I run this
code. Somebody knows what could be the problem ?

With Worksheets("Mechanismen volgens object")
Set rng = .Range(.Cells(2, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

For Each cell In rng
countc = cell.Offset(0, 5).Value
If cell.Offset(0, 2).Value = "x" Then
s = s & countc & cell.Value & Chr(10)
End If
Next



--
floep
------------------------------------------------------------------------
floep's Profile: http://www.excelforum.com/member.php...o&userid=36853
View this thread: http://www.excelforum.com/showthread...hreadid=565995




All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com