Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help, I can't figure this out


I'm sorry because I'm not fully understood your question (due to my wea
English).

Does 36-40 means from row 36 to 40?
Does the other workbook are in the same folder/directory with mai
workbook?

BTW here is a sample code that open a workbook (written on the ro
36-40 in column E) and look at column K in first sheet of the newl
opened workbook. If it found "Q" in that column, it will write fro
column A to H of the row to the Main workbook. Is this is what yo
wanted?

This sample may not conform 100% with your requirement but may be i
will get you started. For example, here I only look from row 1 to 10 i
the column K of the newly opened workbook. You have to alter to sui
yours.

Sub CopyFromOtherWB()

Dim strFileName As String
Dim lngRow As Long
Dim lngKRow As Long
Dim wbMain As Workbook
Dim lngSRow As Long

Set wbMain = ThisWorkbook
lngSRow = 1

For lngRow = 36 To 40
If Cells(lngRow, "E").Value < "" Then
strFileName = Cells(lngRow, "E").Value
Workbooks.Open strFileName
With ActiveWorkbook.Sheets(1)
For lngKRow = 1 To 10
If Cells(lngKRow, "K").Value = "Q" Then
.Range(.Cells(lngKRow, "A"), .Cells(lngKRow
"H")).Copy _
Destination:=wbMain.Sheets(3).Cells(lngSRow
"A")
lngSRow = lngSRow + 1
End If
Next
End With
Workbooks(strFileName).Close savechanges:=False
End If
Next

MsgBox "Finish"

End Sub

Good luck,
hidek

--
hidek
-----------------------------------------------------------------------
hideki's Profile: http://www.excelforum.com/member.php...fo&userid=1890
View this thread: http://www.excelforum.com/showthread.php?threadid=47995

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
Can't figure this out... jmj713 Excel Discussion (Misc queries) 8 April 11th 09 02:33 AM
HOW TO 'BLINK' A FIGURE INSTEAD OFF BOLDING THE FIGURE Nad.Engoor Excel Worksheet Functions 3 December 30th 08 03:04 PM
Pg 98 - Figure 3-24 Help JimMay Excel Discussion (Misc queries) 2 June 10th 06 06:03 PM
Can't Figure what I did Tony_NYCOM Excel Discussion (Misc queries) 2 May 28th 06 10:32 PM
Can anyone help me figure this out? ski Excel Programming 3 October 6th 04 11:22 PM


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