LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Macro - IF command

Not tested at all but something along these lines:

Private Sub CommandButton4_Click()
Dim FileNames As Variant
Dim FileCount as Long
Dim DestWB As Workbook

Set DestWB = Application.Workbooks.Open("hawkmasterrep.xls") 'Add full
path

FileNames =GetOpenFileName(Multiselect=true)
If filenames<false then
For FileCount=0 to UBound(filenames)
With Workbooks.Open(Filenames(filecount), ReadOnly:=True)
.Sheets("Hide").Visible = True
.Sheets("Hide").Range("A4:BB4").Copy

DestWB.Sheets("Data").Range("A2").Offset(filecount ,
0).PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
.Close (False)
End With
FileCount=FileCount+1
loop
end if

NickHK

"okanem" wrote in
message ...

Nick, thanks for the reply, its not the white space I dislike, merely
the number of ' I have to delete if the code per order is multi line.

Can you elaborate on the Application.GetOpenFileName(Multiselect=True)
and show me how to incorporate it in my code.

Rgds
Okanem


--
okanem
------------------------------------------------------------------------
okanem's Profile:

http://www.excelforum.com/member.php...fo&userid=9301
View this thread: http://www.excelforum.com/showthread...hreadid=558216



 
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
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
macro command Param Excel Worksheet Functions 2 February 23rd 06 07:51 AM
Macro Command VickyC Excel Discussion (Misc queries) 1 December 2nd 05 01:05 AM
Macro Command VickyC[_3_] Excel Programming 0 December 1st 05 02:01 PM
macro command Shifting of Multiple Row to the right Excel Discussion (Misc queries) 3 September 15th 05 05:02 AM


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