Jumat, 19 Oktober 2012

[ExcelVBA] Using cell values from one sheet as workbook and spreadsheet names

 


Hi

I have a list of workbooks and spreadsheet names in one spreadsheet to
which I want to write values as appropriate.

How can I use the cell value to define the workbook/spreadsheet which to
open and write values to?

I have tried something like:

Dim Wkbk1 as Workbook (or worksheet)]
Dim Wkbk2 as Workbook (or worksheet)]
Dim Doc
Dim Sheetname1

Wkbk1 = Sheets("OS TKT (TL)").Range("X4").Value
Doc = Sheets("OS TKT (TL)").Range("X12").Value

Set Sheetname1 = ("M (10)") >>

>>> I want to be able to assign and change sheet name "M (10)" here and
use names from a list in another workbook/sheet.

Sheetname1.Cells(iRow, 4).Value = Data (it's OK!)

CurJobNo = Sheets Sheetname1 .Range("D41").Value (Nothing Ive tried
concatenating values has worked)

Summing up:

Workbook1/Sheet N : contains list of workbooks and values to be written

Workbook (?)/Sheet (?): workbook/sheets to be writen to, names (?) from
lists in Workbook1

Many thanks

Laerte

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar