Results 1 to 2 of 2

Invalid Procedure Call (Mid fxn)

Threaded View

  1. #1
    Registered User
    Join Date
    04-26-2011
    Location
    20001
    MS-Off Ver
    Excel 2010
    Posts
    4

    Invalid Procedure Call (Mid fxn)

    Can't figure out what I'm doing wrong. Receive an Invalid Procedure Call or Argument error. Code stops at Mid function. Any help? Thanks. Receive same error when I replace ActiveCell in the Mid fxn with Range("A1")

    Sub manip()
    
    Dim strCon As String, strMod As String
    Dim begin As Long, leng As Long
    Dim hash As Long
    
    Worksheets("sheet1").Activate
    ActiveSheet.Range("A1").Activate
    
    For i = 1 To ActiveSheet.UsedRange.Rows.Count Step 1
    
    strCon = ActiveCell.Offset(i, 5).Value
    begin = (InStr(1, strCon, "story:") - 7)
    hash = InStr(1, strCon, " <")
    Range("a1").Offset(i, 7) = begin
    Range("a1").Offset(i, 8) = hash
    leng = hash - begin - 7
    strMod = Mid((ActiveCell.Offset(i, 5).Value), begin, leng)
    Next i
    
    End Sub
    Last edited by romperstomper; 04-26-2011 at 08:18 AM. Reason: code tags

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