Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109686

Re: MsgBox if within selected rows a specific column is not filled in

From Claus Busch <claus_busch@t-online.de>
Newsgroups microsoft.public.excel.programming
Subject Re: MsgBox if within selected rows a specific column is not filled in
Date 2016-11-25 22:49 +0100
Organization A noiseless patient Spider
Message-ID <o1abjq$kat$1@dont-email.me> (permalink)
References <5144d3c1-c6a9-4438-adda-59ea62ec79df@googlegroups.com>

Show all headers | View raw


Hi Johan,

Am Fri, 25 Nov 2016 12:33:56 -0800 (PST) schrieb jmslab@xs4all.nl:

> In a sheet several rows are selected. It could be rows near eachother (like row 5 till 15) or even rows that are not near eachother (like row 5 till 15 and also row 25 till 30). It could be also only one or two separated rows.
> 
> I have a macro that do some follow up actions with those selected rows, but in in those selected rows in column K there must be data filled in in each row of it.
> 
> If in one of them the datafield in column K is empty, I want a MsgBox which shows me the number of empty datafields in column K.

try:

Sub Test()
Dim rngC As Range
Dim varEmpty() As Variant
Dim n As Long, i As Long
Dim myStr As String

For Each rngC In Intersect(Range("K:K"), Selection)
    If Len(rngC) = 0 Then
        i = i + 1
        ReDim Preserve varEmpty(n)
        varEmpty(n) = rngC.Address(0, 0)
        n = n + 1
    End If
Next
myStr = Join(varEmpty, Chr(10))
MsgBox "These " & i & " cells are empty:" & Chr(10) & myStr
End Sub


Regards
Claus B.
-- 
Windows10
Office 2016

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

MsgBox if within selected rows a specific column is not filled in jmslab@xs4all.nl - 2016-11-25 12:33 -0800
  Re: MsgBox if within selected rows a specific column is not filled in Claus Busch <claus_busch@t-online.de> - 2016-11-25 22:49 +0100
    Re: MsgBox if within selected rows a specific column is not filled in Claus Busch <claus_busch@t-online.de> - 2016-11-26 00:06 +0100
      Re: MsgBox if within selected rows a specific column is not filled in jmslab@xs4all.nl - 2016-11-25 23:24 -0800
  Re: MsgBox if within selected rows a specific column is not filled in aokoa12 <aokoa12@gmail.com> - 2016-11-26 06:23 +0000

csiph-web