+ Reply to Thread
Results 1 to 9 of 9

Need help with an if statement

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    Thank you for your replies , here is my code
    Here is what I have tried so far and here are the results I have gotten


    **********************************************************
    Private Sub UnhideHide(x As Integer)
    Dim CrosstableCorner As Range
    Set CrosstableCorner = Range("Crosstable_Corner")

    x = x - 1

    Dim TeamsThirdRow As Range
    Dim TeamsFourthRow As Range
    Dim BothTeams As Range
    Set TeamsThirdRow = Range(CrosstableCorner.Offset(x * 4 + 3, 1), CrosstableCorner.Offset(x * 4 + 3, 60))
    Set TeamsFourthRow = Range(CrosstableCorner.Offset(x * 4 + 4, 1), CrosstableCorner.Offset(x * 4 + 4, 60))
    Set BothTeams = Range(CrosstableCorner.Offset(x * 4 + 3, 1), CrosstableCorner.Offset(x * 4 + 4, 60))
    Dim y As Integer
    y = 1

    If Application.CountA(TeamsFourthRow) = 0 Then
    TeamsThirdRow.EntireRow.Hidden = Not TeamsThirdRow.EntireRow.Hidden
    Else
    TeamsThirdRow.EntireRow.Hidden = Not TeamsThirdRow.EntireRow.Hidden
    TeamsFourthRow.EntireRow.Hidden = Not TeamsFourthRow.EntireRow.Hidden
    End If
    End Sub
    *******************************************************

    If Len(TeamsFourthRow.value) = 0 "" Then
    Syntax error doesnt recognize 'Then'

    If TeamsFourthRow.Value = "" Then
    mismatched type

    If IsEmpty(TeamsFourthRow.Value) Then
    simply ingores the if statement, executes the else
    in either case, I placed values in the range to test


    THIS DOES WORK !!!
    if application.counta(TeamsFourthRow.Value) = 0



    NOW
    I am trying to put a statement in that will prevent any unhidding at all
    if both ranges are empty

  2. #2
    Forum Contributor
    Join Date
    06-27-2006
    Posts
    310
    The y is a leftover that should have been omitted

    Dim y As Integer
    y = 1

+ 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