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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,929
Messages
6,122,314
Members
449,081
Latest member
tanurai

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