RSS Feed

Syndicate content

alcune funzioni (es: Windows(\"pipe sbo cockpit 081008.xls\").Activate) usano al loro interno il nome del workbook e quindi ogni volta devo cercare nelle macro il nome del file e modificarlo. Come posso impostare il nome del file come variabile ed utilizzarlo all'interno delle funzioni?

Submitted by aterzaghi on Tue, 11/11/2008 - 22:05

E' possibile fare in questo modo:

Sub p()
Dim F As Workbook
Set F = Workbooks("Book1")
End Sub

e utilizzare la variabile F al posto di Workbook(..)

ad esempio:

F.Worksheets(1).Cells(1, 1).Value = "1"

scrive nel foglio 1 del file "Book1" nella cella A1 il numero 1

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <style> <center> <p>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Custom Search