Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Print cell contents in a message box

  1. #1
    Guest

    Default

    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.





  2. #2
    Guest

    Default

    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"

  3. #3
    Guest

    Default

    Yeah, sorry I was mistaking there.
    Hey thnanks for the help!

    Remi.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •