Results 1 to 4 of 4

Issue with If Statement

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Issue with If Statement

    I am trying to pull together three different locations into one cell. The first location will always be entered, but its not a given that the second or third will be entered (the second may be entered, but not the third; or the third may be entered but not the second) - see the attached file.

    I am trying to use If Statements to determine if there is something in the cell, and if so include it into a single cell. Here is the code I am using (although, its not working):

    Range("D1") = Range("B1") & _
            If Not (Range("B2")) = "" Then
                Chr(10) & Range ("B2")
            End If & _
            
            If Not (Range("B3")) = "" Then
                Chr(10) & Range ("B3")
            End If
    Does this make sense? I'm sure it's easy to do . . . but I'm still working my way through VBA.

    Thanks!
    Attached Files Attached Files

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