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


Groups > microsoft.public.excel.programming > #109684 > unrolled thread

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

Started byjmslab@xs4all.nl
First post2016-11-25 12:33 -0800
Last post2016-11-26 06:23 +0000
Articles 5 — 3 participants

Back to article view | Back to microsoft.public.excel.programming


Contents

  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

#109684 — MsgBox if within selected rows a specific column is not filled in

Fromjmslab@xs4all.nl
Date2016-11-25 12:33 -0800
SubjectMsgBox if within selected rows a specific column is not filled in
Message-ID<5144d3c1-c6a9-4438-adda-59ea62ec79df@googlegroups.com>
Hello,

If somebody can help me :)


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.

In a quick view:  MsgBox -> NrOf Empty datafields in column K in the selected rows.


regards,  Johan


[toc] | [next] | [standalone]


#109686

FromClaus Busch <claus_busch@t-online.de>
Date2016-11-25 22:49 +0100
Message-ID<o1abjq$kat$1@dont-email.me>
In reply to#109684
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

[toc] | [prev] | [next] | [standalone]


#109687

FromClaus Busch <claus_busch@t-online.de>
Date2016-11-26 00:06 +0100
Message-ID<o1ag2f$707$1@dont-email.me>
In reply to#109686
Hi Johan,

Am Fri, 25 Nov 2016 22:49:57 +0100 schrieb Claus Busch:

> Sub Test()

better 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
Select Case i
    Case 0
        Exit Sub
    Case 1
        myStr = varEmpty(0)
    Case Else
        myStr = Join(varEmpty, Chr(10))
End Select
MsgBox "These " & i & " cell(s) are empty:" & Chr(10) & myStr
End Sub


Regards
Claus B.
-- 
Windows10
Office 2016

[toc] | [prev] | [next] | [standalone]


#109689

Fromjmslab@xs4all.nl
Date2016-11-25 23:24 -0800
Message-ID<e2efea5e-4a40-4400-aa2d-7da4e22eaf3d@googlegroups.com>
In reply to#109687
Amazing. Thanks !

regards, Johan

[toc] | [prev] | [next] | [standalone]


#109688

Fromaokoa12 <aokoa12@gmail.com>
Date2016-11-26 06:23 +0000
Message-ID<aokoa12.127ee5d8@excelbanter.com>
In reply to#109684
*     [image:
http://batdongsanquangninh.vn/images/banners/logo.png]*
WEBSITE BATDONGSANQUANGNINH.VN LÃ* WEBSITE HÃ*NG đầU Về
QUảNG CáO, MUA BáN BấT độNG SảN TạI QUảNG NINH, CHÃ*NH
THứC đươC THÃ*NH Láº*P VÃ*O NăM 2012. LÄ©NH Vá»±C HOạT độNG
CHÃ*NH Cá»§A CôNG TY LÃ* QUảNG CáO, Tư VấN, MôI GIá»›I, MUA
BáN, CHO THUê BấT độNG SảN.
Trải qua nhiều năm hoạt động chúng tôi đã nỗ lực
vượt qua mọi khó khăn để dần từng bước thay đổi
được phương thức quảng cáo vÃ* mua bán truyền thống
cá»§a người dân thÃ*nh phố giúp cho Người bán vÃ* Người
mua rá»… dÃ*ng thá»±c hiện các giao dịch mua bán nhÃ*, đất
một cách minh bạch, nhanh chóng. Rút kinh nghiệm qua việc
hoạt động nhiều năm và từ những ý kiến đóng góp
của quý khách, trong thời gian tới chúng tôi sẽ nỗ lực
hÆ¡n nưa nhằm phát triển Website có thêm những tÃ*nh năng ưu
việt, quảng bá rộng khắp hơn nữa giúp cho các giao dịch
được tiến hÃ*nh má»™t cách nhanh chóng.

Ra đời xuất phát từ trải nghiệm thực tế của
chÃ*nh người sáng láº*p ra Công ty vá»›i mong muốn giúp cho
cộng đồng có được thông tin minh bạch mang lại giá trị
lợi Ã*ch tốt nhất cho khách hÃ*ng. Đây chÃ*nh lÃ* cÆ¡ sở
nền tảng để công ty xây dựng phương châm kinh doanh với
mong muốn mang đến sá»± chuyên nghiệp, uy tÃ*n, niềm tin cho
khách hÃ*ng.

::*CáC DịCH Vụ CHÃ*NH*:::
- Đăng tin quảng cáo mua bán nhÃ* đất
- Đăng banner quảng cáo
- Đăng bÃ*i PR quảng bá sản phẩm, dịch vụ bất động
sản
- Tư vấn, mua bán bất động sản
- Môi giới bất động sản
- 'bất động sản quảng ninh' (http://batdongsanquangninh.vn)
- 'mua đất hạ long' (http://batdongsanquangninh.vn)
- 'bán nhÃ* quang ninh' (http://batdongsanquangninh.vn)
- 'ban đất ha long' (http://batdongsanquangninh.vn)
*::MọI THôNG TIN đóNG GóP, QUý KHáCH VUI LòNG LIêN Hệ::*

*Địa chỉ : Nguyễn Văn Cừ - Hạ Long - Quảng
Ninh**Điện thoại : 0984.690.188**Email :
batdongsanquangninh.vn@gmail.com*




-- 
aokoa12

[toc] | [prev] | [standalone]


Back to top | Article view | microsoft.public.excel.programming


csiph-web