Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Updating VB for info entered in a sheet

Hi There,

Ive got VB that opens a workbook, runs a macro on it and closes the
workbook.
Currently the VB refers to a specific location.

I would like for the user to select from a drop down within the current
book the locaton onto which the VB should run, ie take data entered into
a sheet and transfer it into VB.

An extract of the current VB is

sName = Dir("\\server1\Area1\*.xls")
Do While sName < ""
Set bk = Workbooks.Open("\\server1\Area1\" & sName)

Call Macro 1

So basically I want the user to be able to change Area1 to Area2 etc..

Is this possible..??

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Updating VB for info entered in a sheet

Set bk = Workbooks.Open("\\server1\" & Range("D2").Value & "\" & sName)


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Darin Kramer" wrote in message
...
Hi There,

Ive got VB that opens a workbook, runs a macro on it and closes the
workbook.
Currently the VB refers to a specific location.

I would like for the user to select from a drop down within the current
book the locaton onto which the VB should run, ie take data entered into
a sheet and transfer it into VB.

An extract of the current VB is

sName = Dir("\\server1\Area1\*.xls")
Do While sName < ""
Set bk = Workbooks.Open("\\server1\Area1\" & sName)

Call Macro 1

So basically I want the user to be able to change Area1 to Area2 etc..

Is this possible..??

Regards

D

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Updating VB for info entered in a sheet

Thanks bob - and how do I define the range to always point to say sheet
master and then d2 ? as several sheets have changed since the first
loop..

Regards

D



*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Updating VB for info entered in a sheet

Set bk = Workbooks.Open("\\server1\" &
Worksheets("Master").Range("D2").Value & "\" & sName)


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Darin Kramer" wrote in message
...
Thanks bob - and how do I define the range to always point to say sheet
master and then d2 ? as several sheets have changed since the first
loop..

Regards

D



*** Sent via Developersdex http://www.developersdex.com ***



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 397
Default Updating VB for info entered in a sheet



thanks!

*** Sent via Developersdex http://www.developersdex.com ***
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
Prevent previous entered data from updating ksell87 Excel Discussion (Misc queries) 1 May 14th 10 12:13 AM
Cannot find info entered when I use filter. HELP! Miss Cobb Excel Discussion (Misc queries) 1 October 20th 08 08:01 PM
Updating a SQL table with information entered in an Excel Database NormaD Excel Programming 0 June 14th 07 10:28 PM
excel, automatic date and time when info gets entered shorty Excel Worksheet Functions 4 April 26th 06 06:46 PM
Copying info entered on one worksheet automatically to another Mpls501sMan Excel Discussion (Misc queries) 0 December 8th 05 04:36 PM


All times are GMT +1. The time now is 09:23 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"