+ Reply to Thread
Results 1 to 4 of 4

Simple: State an If Block more concisely

Hybrid View

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    United States of America
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Simple: State an If Block more concisely

    Dear Leith Ross,

    That is wonderful. I really liked how you approached the logic.


    Dear OllyXLS,

    I just tried your format option and it also worked great.


    Thank you both for responding so quickly. Thread solved and +rep.


    EDIT 1: Spoke too soon. I tried the format option again and I am still getting the rounding problem. (Leith Ross' logic is of course, unaffected and therefore still sound)

    EDIT 2: For future reference, I amended Leith Ross' code and went with this.

    Dim timeTaken As String
    
        If timeB < 59 Then
                timeTaken = (timeB Mod 60) & " second(s)"
            Else
                timeTaken = Round((timeB / 60), 0) & " minute(s) and " & (timeB Mod 60) & " second(s)"
        End If
    
        If deleteStr = "" Then
                MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
                    "Total Time Taken: " & timeTaken, vbInformation, "Log Summary"
            Else
                MsgBox "The data tables have been cleaned." & vbCrLf & vbCrLf & _
                    "Respondent answers matching '" & deleteStr & "' have been removed." & vbCrLf & vbCrLf & _
                    "Total Time Taken: " & timeTaken, vbInformation, "Log Summary"
        End If
    Last edited by Doug Nguyen; 02-21-2014 at 03:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 10-09-2012, 10:44 AM
  2. [SOLVED] Can VB Save hidden/grouped columns state, unhide all, then restore columns to saved state
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-27-2012, 02:54 PM
  3. Replies: 2
    Last Post: 06-22-2010, 07:55 AM
  4. Simple IF Satement Road Block Please HELP
    By needtolearn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-08-2006, 04:20 AM
  5. Simple if statement road block
    By needtolearn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2006, 02:11 AM

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