Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy cell of one excel sheet to other

Hi,
I have a folder that contains Excel files. The files are numbered a0
to a1000;b1 to b2000; c1 to c3000; d1 to d4000; e1 to e5000; and f1 to
f561(A total of 5562 Excel files). I need to copy the B column 11124
row (cell) in each file and paste it in a new Excel file in one column
in the same order.(I mean the a0 file B column 11124 row cell should
be pasted in A column 1 st row cell of a new excel file; a1 file B
column 11124 row cell to be pasted in A column 2nd row cell of a new
excel file and so on... for all the 5562 files).
I would be really thanlful if you could kindly let me know the
complete code with procedure to do it. Thanks in advance. Awaiting
code procedure at the earliest possible attention.
Thanks;
Mapa.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Copy cell of one excel sheet to other

See your other thread

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mohan" wrote in message ups.com...
Hi,
I have a folder that contains Excel files. The files are numbered a0
to a1000;b1 to b2000; c1 to c3000; d1 to d4000; e1 to e5000; and f1 to
f561(A total of 5562 Excel files). I need to copy the B column 11124
row (cell) in each file and paste it in a new Excel file in one column
in the same order.(I mean the a0 file B column 11124 row cell should
be pasted in A column 1 st row cell of a new excel file; a1 file B
column 11124 row cell to be pasted in A column 2nd row cell of a new
excel file and so on... for all the 5562 files).
I would be really thanlful if you could kindly let me know the
complete code with procedure to do it. Thanks in advance. Awaiting
code procedure at the earliest possible attention.
Thanks;
Mapa.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Copy cell of one excel sheet to other

This is untested, but should do what you describe.
It assumes it processes all workbooks in a specific directory.
It assumes these have names like a0.xls and f561.xls

It assumes the value you want is on the first worksheet in those workbooks.

Sub copydata()
Dim sh As Worksheet
Dim sPath As String, fname As String
Dim rw As Long, s As String
Dim s1 As String
Dim bk As Workbook
Set sh = ActiveSheet
sh.Cells(1, 2).EntireColumn.Insert
sPath = "C:\Myfolder\"
fname = Dir(sPath & "*.xls")
rw = 0
Do While fname < ""
s1 = Left(fname, 1) & Format(CLng(Mid(s, 2)), "00000")
Set bk = Workbooks.Open(sPath & fname)
rw = rw + 1
sh.Cells(rw, 1).Value = bk.Worksheets(1) _
.Range("B11124").Value
sh.Cells(rw, 2).Value = s1
bk.Close SaveChanges:=False
fname = Dir()
Loop
sh.Range("A1").CurrentRegion.Sort Key1:=sh.Range("B1"), _
order1:=xlAscending, Header:=xlNo
sh.Columns(2).Delete
End Sub

--
Regards,
Tom Ogilvy



"Mohan" wrote:

Hi,
I have a folder that contains Excel files. The files are numbered a0
to a1000;b1 to b2000; c1 to c3000; d1 to d4000; e1 to e5000; and f1 to
f561(A total of 5562 Excel files). I need to copy the B column 11124
row (cell) in each file and paste it in a new Excel file in one column
in the same order.(I mean the a0 file B column 11124 row cell should
be pasted in A column 1 st row cell of a new excel file; a1 file B
column 11124 row cell to be pasted in A column 2nd row cell of a new
excel file and so on... for all the 5562 files).
I would be really thanlful if you could kindly let me know the
complete code with procedure to do it. Thanks in advance. Awaiting
code procedure at the earliest possible attention.
Thanks;
Mapa.


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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Excel? How to copy sheet in workbook w/o having reconfirm cell nam Robert M Excel Discussion (Misc queries) 2 May 17th 08 03:10 PM
copy data of two cells from Sheet 2 into one cell in Sheet 1 cahabbinga Excel Worksheet Functions 6 January 30th 08 01:00 PM
how to copy a cell with formula from sheet 1 (data is all vertical) into sheet 2 parag Excel Worksheet Functions 3 June 15th 06 10:29 PM
Copy text from same cell on every sheet to title sheet? Jon Excel Discussion (Misc queries) 2 February 9th 05 03:11 PM


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