Results 1 to 3 of 3

Troubleshooting If statement

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Troubleshooting If statement

    The macro below is intended to call a macro named idgenerator, then check to see if range G8:H8 is not blank, and then save the workbook to a specific location but is failing to a type mismatch error on the first line of the if statement. Can anyone shed some light on this?

    Public Sub nonprotsaveas()
    Call IDgenerator
    
    
    If ActiveSheet.Range("G8:H8") = "" Then
       MsgBox ("Please select a product category before sending this request")
       Exit Sub
      End If
      
    ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\udcg012\My Documents\Sample Request Project\Non Protein\" & Range("G8:H8") & "\" & Range("c3").Value & " " & Range("c5").Value & " " & Format$(Date, "mm-dd-yyyy") & ".xlsm"
    End Sub

    Thanks!
    Clayton Grove
    Last edited by dcgrove; 04-12-2011 at 12:09 PM.

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