Sunday, March 7, 2010

How to set up a macro that would use the active sheets names in the worksheets ?

For instance : I have a file with a 100 worksheets, and in each sheet i need to have written '; Whatever + active worksheet name'; ?


ThanksHow to set up a macro that would use the active sheets names in the worksheets ?
in english please!!!!How to set up a macro that would use the active sheets names in the worksheets ?
no
This code will go through all the worksheets and put ';Worksheets %26lt;SheetName%26gt;'; in cell A1:





For i = 1 To Sheets.Count


Sheets(i).Select


Range(';A1';).Value = ';Worksheet '; %26amp; Sheets(i).name


Next i
The answer is in the question.





Rawlyn.
I'm not quite sure what you mean, but this may be part of your solution:





In Excel, you can link to other cells in other files using the following syntax:





=[FILENAME.xls]SHEET!CELL





So, if you have a file name ';c:\file.xls';, and a sheet called ';Sheet1';, and you want to link to cell A1, you should write the following in your cell:





='c:\[file.xls]Sheet1'!$A$1





You can also create this link automatically (without any coding) by opening both files, then from your first file, press '=' then link to your second file and select the cell of your choice. Press 'Enter' and you'll see the result in your cell.





Hope this helps!

No comments:

Post a Comment