VBA Msgbox

AussieVic

Active Member
Joined
Jan 9, 2009
Messages
364
Hi, i am after VBA msgbox which will tell me if there is data from A6:A & C6:C


Excel Workbook
ABCD
6LifeCommentsNomsComments
7Test1Test1
8Test2Test2
9Test3Test3
10Test4Test4
11Test5Test5
12Test6Test6
13Test7Test7
14Test8Test8
15Test9
16Test10
17Test11
18Test12
19Test13
20Test14
21Test15
22Test16
23Test17
Sheet1
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Something like this maybe:

<font face=Calibri><SPAN style="color:#00007F">Sub</SPAN> foo()<br>    <SPAN style="color:#00007F">Dim</SPAN> x <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN>, y <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Long</SPAN><br>        x = Application.WorksheetFunction.CountA(Range("A:A")) - 1<br>        y = Application.WorksheetFunction.CountA(Range("C:C")) - 1<br>        <br>        MsgBox "There are " & x & " entries in column A" & vbCrLf & vbCrLf & _<br>            "There are " & y & " entries in column C", vbInformation + vbOKOnly, "Entry Count"<br>            <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>

HTH,
 
Upvote 0
This could be a start...It is not great but maybe give some ideas and options.

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Data()<br><br><SPAN style="color:#00007F">If</SPAN> Range("A6:A" & Range("A6").End(xlDown).Row).Count > 0 Or _<br>        Range("C6:C" & Range("C6").End(xlDown).Row).Count > 0 <SPAN style="color:#00007F">Then</SPAN><br>      <br>            MsgBox "Data is found in range(s):  " & vbNewLine & _<br>                Range("A6:A" & Range("A6").End(xlDown).Row).Address & vbNewLine & _<br>                Range("C6:C" & Range("C6").End(xlDown).Row).Address<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    <br>    <br>End <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top