我正在尝试将数据从workbook1提取到workbook2,它满足workbook1中的某些条件。以下是我的代码。
Sub Button1_Click()
Dim iLast As Long
Dim i As Long, j As Long
Dim targetlastrow As Long, sourcelstrow As Long
Dim Sourcelastcol As Long
Dim source As Worksheet
Dim target As Worksheet
Dim InputRng As Range
Dim OutRng As Range
Dim xCol As Integer
Set source = Workbooks("workbook1").Sheets(1)
Set target = Workbooks("workbook2").Sheets("Sheet1")
xRow = 10
Set InputRng = source.Range("F2:F" & 41)
Set InputRng = InputRng.Columns(1)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
xCol = InputRng.Cells.Count / xRow
ReDim xArr(1 To xRow, 1 To xCol + 1)
For i = 0 To InputRng.Cells.Count - 1
xValue = InputRng.Cells(i + 1)
iRow = i Mod xRow
iCol = VBA.Int(i / xRow)
xArr(iRow + 1, iCol + 1) = xValue
Next
OutRng.Resize(UBound(xArr, 1), UBound(xArr, 2)).Value = xArr
End Sub
这是示例输出工作簿2
来自workbook1的示例数据
目前我设法从工作簿1中取出所有前40个数据:F列。但是我试图仅通过PASS条件提取前40个数据。请参阅Workbook1 C列。
请帮忙。我是新用的vba。
答案 0 :(得分:0)
尝试使用以下代码。
ServerName 127.0.0.1:80
ProxyRequests Off
ProxyPreserveHost On
ProxyVia Full
<Proxy *>
Require all granted
</Proxy>
<Location /api>
ProxyPass http://localhost:3000/api
ProxyPassReverse http://localhost:3000/api
</Location>
Alias /admin /var/www/wordpress/Commdev
<Directory /var/www/wordpress/Commdev>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Alias / /var/www/html/ui
<Directory /var/www/html/ui>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>