Results 1 to 4 of 4

Pass value of Object to String

Threaded View

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177

    Pass value of Object to String

    SLogin2 is a string
    sh7CellG is an Object (according to Error 424, Object required)

    Im trying to pass the value of sh7CellG.Offset(0,1) to sLogin2

    When I check the value of sh7CellG.Offset(0,1) via msgbox, its exactly what it should be.
    So how do I pass the value of sh7CellG.Offset(0,1) to sLogin2?
        With Sheets("Misc data")
            'Loop thru Column F
            sh7LastRowG = .Cells(Rows.Count, "G").End(xlUp).Row
            Set sh7RangeG = .Range("G1:G" & sh7LastRowG)
        End With
    
        For Each sh7CellG In sh7RangeG
            If sh7CellG = sLogin Then
                Do While sLogin <> sLogin    ' ""
                    MsgBox "You must enter your Intitals, initials must be approved! (Caps only!)"
                    sLogin = InputBox("Enter Initials here (Caps only!)")
                Loop
    
                MsgBox sh7CellG.Offset(0, 1)  'for testing
                sLogin2 = sht7CellG.Offset(0,1)  <-----Offending line of code "error 424"
                Call Button_Controls.Buttons_Enabled
            End If
        Next sh7CellG
    (Ref: http://www.excelforum.com/excel-prog...e-dynamic.html)
    Last edited by Rick_Stanich; 06-05-2012 at 11:10 AM.
    Regards

    Rick
    Win10, Office 365

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