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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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,376
Messages
6,119,175
Members
448,870
Latest member
max_pedreira

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