#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default pop up window

Is it possible to have a small pop up window to appear each time after you
putting the data and pop up window asks for which worksheet to open? I would
be extremely grateful if someone can guide me. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default pop up window

The following worksheet event code monitors cell B9. Once you have entered a
value in B9, a window pops up to allow you to select a file and open it:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set B9 = Range("B9")
If Intersect(t, B9) Is Nothing Then Exit Sub
s = Application.GetOpenFilename
Workbooks.Open Filename:=s
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200808


"tleehh" wrote:

Is it possible to have a small pop up window to appear each time after you
putting the data and pop up window asks for which worksheet to open? I would
be extremely grateful if someone can guide me. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default pop up window

Thank you for your answer. It works fine. But this is what i am trying to do.
I have a file that contains 26 worksheets. I am trying to have a pop up
window each time a value is entered. After a value is entered, it asks which
worksheet to pick next. Thanks.

Gary''s Student" wrote:
The following worksheet event code monitors cell B9. Once you have entered a
value in B9, a window pops up to allow you to select a file and open it:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set B9 = Range("B9")
If Intersect(t, B9) Is Nothing Then Exit Sub
s = Application.GetOpenFilename
Workbooks.Open Filename:=s
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200808


"tleehh" wrote:

Is it possible to have a small pop up window to appear each time after you
putting the data and pop up window asks for which worksheet to open? I would
be extremely grateful if someone can guide me. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default pop up window

Hi,
You can modify the code you were given:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim insect As Range
Dim Y As String
Set insect = Intersect(Target, Range("B1:B10"))

If insect Is Nothing Then Exit Sub
Y = InputBox("What sheet do you want to put this in?")
Sheets(Y).Activate
End Sub

You realize, of course, that you are not doing anything but moving to the
sheet. I suspect you want to do more but you haven't told us what.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


"tleehh" wrote:

Thank you for your answer. It works fine. But this is what i am trying to do.
I have a file that contains 26 worksheets. I am trying to have a pop up
window each time a value is entered. After a value is entered, it asks which
worksheet to pick next. Thanks.

Gary''s Student" wrote:
The following worksheet event code monitors cell B9. Once you have entered a
value in B9, a window pops up to allow you to select a file and open it:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set B9 = Range("B9")
If Intersect(t, B9) Is Nothing Then Exit Sub
s = Application.GetOpenFilename
Workbooks.Open Filename:=s
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200808


"tleehh" wrote:

Is it possible to have a small pop up window to appear each time after you
putting the data and pop up window asks for which worksheet to open? I would
be extremely grateful if someone can guide me. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default pop up window

Thank you very Much! this is exactly what i was trying to accomplish. Thank
you...
What if you have larger cell range to work with.
lets say:
B1:B10
C1:C10
D1:D10
E1:E10
F1:F10
G1:G10
Thank you.

"ShaneDevenshire" wrote:

Hi,
You can modify the code you were given:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim insect As Range
Dim Y As String
Set insect = Intersect(Target, Range("B1:B10"))

If insect Is Nothing Then Exit Sub
Y = InputBox("What sheet do you want to put this in?")
Sheets(Y).Activate
End Sub

You realize, of course, that you are not doing anything but moving to the
sheet. I suspect you want to do more but you haven't told us what.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


"tleehh" wrote:

Thank you for your answer. It works fine. But this is what i am trying to do.
I have a file that contains 26 worksheets. I am trying to have a pop up
window each time a value is entered. After a value is entered, it asks which
worksheet to pick next. Thanks.

Gary''s Student" wrote:
The following worksheet event code monitors cell B9. Once you have entered a
value in B9, a window pops up to allow you to select a file and open it:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set B9 = Range("B9")
If Intersect(t, B9) Is Nothing Then Exit Sub
s = Application.GetOpenFilename
Workbooks.Open Filename:=s
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200808


"tleehh" wrote:

Is it possible to have a small pop up window to appear each time after you
putting the data and pop up window asks for which worksheet to open? I would
be extremely grateful if someone can guide me. Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to save a desired window size but hv window comeup fullsz by d smjm1982 Excel Discussion (Misc queries) 1 February 15th 08 11:10 AM
View cell contents as a pop-up window (similar to comments window) Oldersox Excel Worksheet Functions 1 February 6th 08 07:09 AM
Docking Project Explorer, Properties window and Code window in VBE jayray Setting up and Configuration of Excel 2 March 27th 07 04:42 PM
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
In Excel - how to delete new window created from window on tool ba Doug Excel Worksheet Functions 1 April 20th 06 09:22 PM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"