Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First I want to change/adjust is to remove the last , (comma) in the MsgBox listing of cells that have a "" or (Select One) in them.
This code line adds the , (commas) cc = cc & " " + c.Address(False, False) & ", " and the list looks like this example in the msgbox B5, C6, G8, Want it to look like this B5, C6, G8 (last comma is gone) Second, instead of selecting the whole OneRng, select only the cells that are listed in the msgbox - the cc values So that only the culprit cells are highlighted. OneRng.Activate (just the cc cells selected here, not the whole range) MsgBox "There are " & cCnt & _ " cells with ""Blank"" or ""(Select One)"" in these cell address'." & vbCr & vbCr & cc Thanks, Howard Sub NextTab_1() Dim bRow As Long, cCnt As Long Dim OneRng As Range, c As Range Dim cc As Variant With ActiveWorkbook.Worksheets("4. Property Information") Set OneRng = Range("B4:S" & Range("B4").End(xlDown).Row).SpecialCells(xlCellTy peVisible) For Each c In OneRng If c = "" Or c = "(Select One)" Then cCnt = cCnt + 1 cc = cc & " " + c.Address(False, False) & ", " End If Next If cCnt 0 Then OneRng.Activate MsgBox "There are " & cCnt & _ " cells with ""Blank"" or ""(Select One)"" in these cell address'." & vbCr & vbCr & cc Else MsgBox "All data point are positive." Sheets("(Lists)").Visible = True Sheets("(Lists)").Activate End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help wanted with Code, Please | Excel Programming | |||
Help wanted with VBA code | Excel Programming | |||
Newby Needs minor tweak on this VBA Macro code for Excel | Excel Programming | |||
VB code almost works...but can't find a minor mistake | Excel Programming | |||
Macro Code minor alteration please. | New Users to Excel |