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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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