LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combining Msg Box and Data

Excel 97 - Have code to get values from a closed workbook.

Once completed I want a Message Box to appear asking if you want t
view the data. If you select Yes it should open up a hidden page. I
you slect No it should move to another page.

I have worked with Msg Boxes a little but am not sure what I am doin
wrong! Keep getting error messages. Here's the code I currently have.

Sub Importmonday()
GetValuesFromAClosedWorkbook "C:\Data", "Day 1.xls", _
"Sheet1", "AX100:BR1977"
End Sub
Sub GetValuesFromAClosedWorkbook(fPath As String, _
fName As String, sName, cellRange As String)
With ActiveSheet.Range(cellRange)
.FormulaArray = "='" & fPath & "\[" & fName & "]" _
& sName & "'!" & cellRange
.Value = .Value
End With
Answer = MsgBox("Do you want to view Rosters?", _
vbYesNo + vbQuestion, "Rosters Imported!")
If Answer = vbYes Then
Sheets("Today").Select
Exit Sub
If Answer = vbYes Then
Sheets("Timeline").Visible = True
Sheets("Timeline").Select
End Sub

While I am fairly new to VBA, I know a little and can't figure out wha
to correct!

Thanks

--
Message posted from http://www.ExcelForum.com

 
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
Combining data nitengale Excel Worksheet Functions 1 March 25th 10 06:57 PM
Combining data Dan Excel Worksheet Functions 3 May 27th 07 03:01 PM
Combining Data [email protected] Excel Discussion (Misc queries) 1 October 20th 06 07:43 PM
combining multiple rows of data into one single row of data myersjl Excel Worksheet Functions 0 March 30th 06 10:39 PM
combining data Carmel R Excel Worksheet Functions 4 September 15th 05 01:56 PM


All times are GMT +1. The time now is 01:16 AM.

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

About Us

"It's about Microsoft Excel"