Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default External data validation

I want to use external data validation. I know how to do it. What I
want to do is have a macro that automatically tells the user that the
external workbook needs to be open and will then open it. Does anyone
know how to do this?

Do I use a change event on the validation error?

Thanks in advance.

Shane

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default External data validation

Hi shane,

One way is to attempt to activate the required workbook and if you get an
error then goto a routine to open it.

The newly opened workbook becomes the active one.

If workbook to open is not in the default path then you will need to add the
path in the wbOpen routine. Record a macro to open it will give you the
required syntax.

Example:

Sub Macro1()

Dim wbName As String

wbName = "Book2.xlsm"

On Error GoTo wbOpen
Windows(wbName).Activate
On Error GoTo 0

MsgBox "Workbook " & ActiveWorkbook.Name & " is open"

GoTo skipwbOpen 'When get to here skip wbOpen

wbOpen:
Workbooks.Open Filename:= _
"Book2.xlsm"
Resume Next

skipwbOpen:

End Sub

Hope it helps.

Regards,

OssieMac

"Shane" wrote:

I want to use external data validation. I know how to do it. What I
want to do is have a macro that automatically tells the user that the
external workbook needs to be open and will then open it. Does anyone
know how to do this?

Do I use a change event on the validation error?

Thanks in advance.

Shane


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 do i reference an external workbook for data validation? Dex Excel Discussion (Misc queries) 2 October 27th 09 06:13 PM
Getting External Data based on criteria insde of the external data BigMacExcel Excel Discussion (Misc queries) 0 August 31st 09 06:41 PM
dynamic link to external workbooks through data validation MrBlades Excel Discussion (Misc queries) 0 August 13th 08 12:11 AM
Validation with External Data Names Chakey Excel Worksheet Functions 0 June 25th 08 06:25 PM
Referring to external workbook in Data Validation aposatsk Excel Discussion (Misc queries) 2 August 21st 06 04:24 PM


All times are GMT +1. The time now is 06:14 PM.

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"