Results 1 to 8 of 8

VBA ignore blank cells

Threaded View

  1. #1
    Registered User
    Join Date
    06-27-2019
    Location
    UK
    MS-Off Ver
    MS OFFICE 2016
    Posts
    24

    VBA ignore blank cells

    I want the run the code below, however in the range C6:AB83 I want to ignore blank cells. I'm guessing If cell <> "" Then run code would do the trick but I'm not sure where to insert. Could you help?


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.ScreenUpdating = False
        If Not Application.Intersect(Target, Sheets("Resource view").Range("C6:AB83")) Is Nothing Then
            If Target.Count > 1 Then
                MsgBox "You have selected multiple cells." & vbNewLine & vbNewLine & "Please select only one cell.", , "Multiple Cells Selected"
                    Exit Sub
            End If
            Sheets("Sheet8").Range("B1").Value = Target.Row
            Sheets("Sheet8").Range("B2").Value = Target.Column
        End If
    Application.ScreenUpdating = True
    End Sub
    Last edited by Chris220; 07-15-2019 at 10:58 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 08-13-2018, 02:30 AM
  2. [SOLVED] how to count cells with values but ignore blank cells with formula and in a month?
    By Imran Magsi in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-17-2017, 03:58 AM
  3. [SOLVED] Ignore blank cells with formulas or ignore NA() in a formula
    By guiismiti in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 03-24-2016, 02:13 PM
  4. Count number of cells in column per month, ignore blank cells
    By lamdl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-13-2014, 08:50 PM
  5. Ignore blank cells and truly blank cells in named range?
    By hschillig in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-13-2014, 02:56 PM
  6. Replies: 5
    Last Post: 05-18-2013, 07:49 PM
  7. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 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