ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro that opens a window giving you info in a few cells (https://www.excelbanter.com/excel-discussion-misc-queries/131717-macro-opens-window-giving-you-info-few-cells.html)

One-Leg

Macro that opens a window giving you info in a few cells
 
Hello,

I have an Excel document with info being updated on a daily base. I have 4
cells (M1 - Q1 - U1 - Y1) in which I have info.

I would like to run a macro that when launched, it will give me a little
window telling me the 4 infos...

Is that possible???

Thanks!!!

Vergel Adriano

Macro that opens a window giving you info in a few cells
 
How about something like this:

Private Sub ShowMessage()
With ActiveSheet
MsgBox "M1 = " & .Range("M1").Text & vbNewLine & _
"Q1 = " & .Range("Q1").Text & vbNewLine & _
"U1 = " & .Range("U1").Text & vbNewLine & _
"Y1 = " & .Range("Y1").Text
End With
End Sub


"One-Leg" wrote:

Hello,

I have an Excel document with info being updated on a daily base. I have 4
cells (M1 - Q1 - U1 - Y1) in which I have info.

I would like to run a macro that when launched, it will give me a little
window telling me the 4 infos...

Is that possible???

Thanks!!!


One-Leg

Macro that opens a window giving you info in a few cells
 
Thanks... It works good but if I have 3 sheets in the document (page1 -
page2 - page3) and when I open the document, I always open the document, I'm
on page1. The info I'm looking for is on page2.

Can I simply do this:

Sub ShowMessage()
With ActiveSheet
MsgBox "M1 = " & .Range("page2!M1").Text & vbNewLine & _
"Q1 = " & .Range("page2!Q1").Text & vbNewLine & _
"U1 = " & .Range("page2!U1").Text & vbNewLine & _
"Y1 = " & .Range("page2!Y1").Text
End With
End Sub

"Vergel Adriano" wrote:

How about something like this:

Private Sub ShowMessage()
With ActiveSheet
MsgBox "M1 = " & .Range("M1").Text & vbNewLine & _
"Q1 = " & .Range("Q1").Text & vbNewLine & _
"U1 = " & .Range("U1").Text & vbNewLine & _
"Y1 = " & .Range("Y1").Text
End With
End Sub


"One-Leg" wrote:

Hello,

I have an Excel document with info being updated on a daily base. I have 4
cells (M1 - Q1 - U1 - Y1) in which I have info.

I would like to run a macro that when launched, it will give me a little
window telling me the 4 infos...

Is that possible???

Thanks!!!


Gord Dibben

Macro that opens a window giving you info in a few cells
 
Private Sub ShowMessage()
With Sheets("page2")
MsgBox "M1 = " & .Range("M1").Text & vbNewLine & _
"Q1 = " & .Range("Q1").Text & vbNewLine & _
"U1 = " & .Range("U1").Text & vbNewLine & _
"Y1 = " & .Range("Y1").Text
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Feb 2007 12:52:07 -0800, One-Leg
wrote:

Thanks... It works good but if I have 3 sheets in the document (page1 -
page2 - page3) and when I open the document, I always open the document, I'm
on page1. The info I'm looking for is on page2.

Can I simply do this:

Sub ShowMessage()
With ActiveSheet
MsgBox "M1 = " & .Range("page2!M1").Text & vbNewLine & _
"Q1 = " & .Range("page2!Q1").Text & vbNewLine & _
"U1 = " & .Range("page2!U1").Text & vbNewLine & _
"Y1 = " & .Range("page2!Y1").Text
End With
End Sub

"Vergel Adriano" wrote:

How about something like this:

Private Sub ShowMessage()
With ActiveSheet
MsgBox "M1 = " & .Range("M1").Text & vbNewLine & _
"Q1 = " & .Range("Q1").Text & vbNewLine & _
"U1 = " & .Range("U1").Text & vbNewLine & _
"Y1 = " & .Range("Y1").Text
End With
End Sub


"One-Leg" wrote:

Hello,

I have an Excel document with info being updated on a daily base. I have 4
cells (M1 - Q1 - U1 - Y1) in which I have info.

I would like to run a macro that when launched, it will give me a little
window telling me the 4 infos...

Is that possible???

Thanks!!!




All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com