Warning: fopen(/www/wwwroot/www.wendadaohang.com/data/md5_content_title/5b/5bd8a3b0044072a181dd90a93baba812.txt): failed to open stream: No space left on device in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2468

Warning: flock() expects parameter 1 to be resource, bool given in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2469

Warning: fclose() expects parameter 1 to be resource, bool given in /www/wwwroot/www.wendadaohang.com/inc/function.php on line 2475
如何将excel中几十个工作表中的某一列提取出来单独做一个excel - 00问答网

如何将excel中几十个工作表中的某一列提取出来单独做一个excel

如题所述

假设这些份文件在一个文件夹中,且若打开某一文件,数据就能看见——即不用点其他sheet。建一新Excel,也存到该文件夹。仅打开该新Excel,同时按Alt+F11进入宏界面,点菜单的插入,模块,粘贴如下代码:

Sub Find()
Application.ScreenUpdating = False
Dim MyDir As String
dim i as integer
i = 1
MyDir = ThisWorkbook.Path & "\"
ChDrive Left(MyDir, 1) 'find all the excel files
ChDir MyDir
Match = Dir$("")
Do
If Not LCase(Match) = LCase(ThisWorkbook.Name) Then
Workbooks.Open Match, 0 'open
Range("F1:F999").copy
thisworkbook.activate
cells(1,i).select
activesheet.paste
Windows(Match).Activate
ActiveWindow.Close
i = i +1
End If
Match = Dir$
Loop Until Len(Match) = 0
Application.ScreenUpdating = True
End Sub

粗体的F表示你的某一列为F列,自己改。在此界面直接按F5运行此宏,完成。
温馨提示:答案为网友推荐,仅供参考
相似回答