+ Reply to Thread
Results 1 to 4 of 4

Problem with an offset

  1. #1
    Registered User
    Join Date
    07-27-2006
    Posts
    23

    Problem with an offset

    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

  2. #2
    Die_Another_Day
    Guest

    Re: 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



  3. #3
    Registered User
    Join Date
    07-27-2006
    Posts
    23
    "Type mismatch"

  4. #4
    Tom Ogilvy
    Guest

    RE: 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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1