Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Passing an index to a second workbook

Hi There,

I have one workbook with a userform & a "HelpButton" on it.

I would like to open a second workbook to show the actual
Help-Description.

I think something should look as underneath but I don't know how I can
pass the Help-index number (in my example "5") to the "Index"-variable
of the 2nd wbk...!

*1st Workbook Userform:

Private Sub HelpButton_Click()
Application.Run "help.xls!ShowUserformHelp", 5
'the 5th index in the HELP
End Sub


*2nd Workbook: "help.xls" :

Sub ShowUserformHelp()
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
Label1.Caption = Application.VLookup(Index, HelpDescription, 2, False)
End Sub


All help welcome,
Brgds Sige

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Passing an index to a second workbook

Hi Again,

Underneath is what I wanted ...
Just having a problem still to open the file when it is closed!
Brgds Sige

1stworkbook
Private Sub HelpButton_Click()
Const Counter As Long = 25

SaveSetting "HelpWorkbook", "Index", "HelpID", Counter
Application.Run "help.xls!ShowUserformHelp"
End Sub

2nd Workbook: "help.xls" :
Sub ShowUserformHelp()
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
Dim Counter As Long
Dim Helpdescription As Range
' Get setting from registry
Counter = GetSetting("HelpWorkbook", "Index", "HelpID", 0)

Set Helpdescription = ThisWorkbook.Sheets("IndexSheet").Range("Help")
Label1.Caption = Application.VLookup(Counter, Helpdescription, 2,
False)
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Passing an index to a second workbook

With Norman Jones' help:

Index not passed via the registry!

Private Sub HelpButton_Click()
Dim icounter As Long
icounter = 7 'Give Index ID
Application.Run "'Sige help(25 Oct 05).xls'!ShowUserformHelp", icounter
'Application.Run "'C:\MyFolder\My File \MyMacro'"
End Sub


I was nearly there ;o)


Sige wrote:
Hi There,

I have one workbook with a userform & a "HelpButton" on it.

I would like to open a second workbook to show the actual
Help-Description.

I think something should look as underneath but I don't know how I can
pass the Help-index number (in my example "5") to the "Index"-variable
of the 2nd wbk...!

*1st Workbook Userform:

Private Sub HelpButton_Click()
Application.Run "help.xls!ShowUserformHelp", 5
'the 5th index in the HELP
End Sub


*2nd Workbook: "help.xls" :

Sub ShowUserformHelp()
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
Label1.Caption = Application.VLookup(Index, HelpDescription, 2, False)
End Sub


All help welcome,
Brgds Sige


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
Passing a range name as an argument to the Index Function Michael Sharpe Excel Discussion (Misc queries) 3 September 5th 12 01:33 PM
Workbook index wally New Users to Excel 4 December 3rd 07 03:26 PM
Passing selected workbook name and values to a macro simora Excel Worksheet Functions 0 May 25th 05 07:24 PM
Passing data to an open workbook from Lotus Notes SunTzuComm Excel Programming 1 August 19th 04 01:51 AM
Passing a Variable from Worksheet to Workbook Susan Lammi Excel Programming 6 August 3rd 03 01:29 AM


All times are GMT +1. The time now is 07:49 AM.

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"