Print cell contents in a message box

G

Guest

Guest
Hi,

I want to print the contents of a cell in a messagebox. However, the horizontal position changes: so A1, A2, A3. I have a var which speficief the horizontal number (form a for next loop)


So, I have to paste some stuff together but I can`t seem tot get it to work.

MsgBox cellcontents A & (horzizontal value which I get from the for next loop) is missing , vbCritical, "Uncomplete"


anyone who can give me hand?
Appreciate it.

Remi
Holland.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Remi,

Firstly, since you mention "horizontal" component changes, I assume you really meant not A1,A2,A3, but rather A1,B1,C1? If this is the case then suppose you have named your "horizontal" (column) index iCol. Then

MsgBox Cells(1,iCol) & " is missing" , vbCritical, "Uncomplete"

If, on the other hand, you really meant to change the row rather than column (in which case your "horizontal" component is really "vertical", then

MsgBox Cells(iRow,1) & " is missing" , vbCritical, "Uncomplete"
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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