Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.excel.programming > #109684 > unrolled thread
| Started by | jmslab@xs4all.nl |
|---|---|
| First post | 2016-11-25 12:33 -0800 |
| Last post | 2016-11-26 06:23 +0000 |
| Articles | 5 — 3 participants |
Back to article view | Back to microsoft.public.excel.programming
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
| From | jmslab@xs4all.nl |
|---|---|
| Date | 2016-11-25 12:33 -0800 |
| Subject | MsgBox 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]
| From | Claus Busch <claus_busch@t-online.de> |
|---|---|
| Date | 2016-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]
| From | Claus Busch <claus_busch@t-online.de> |
|---|---|
| Date | 2016-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]
| From | jmslab@xs4all.nl |
|---|---|
| Date | 2016-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]
| From | aokoa12 <aokoa12@gmail.com> |
|---|---|
| Date | 2016-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 hoaÌ£t động nhiều năm vaÌ€ 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