Sub a()
Dim x
For x = 1 To Range("a1000")End(xlUp)Row
If Cells(x, 1) = "北京" Then
Cells(x, 2) = Cells(x, 1)Address
Cells(x, 3) = Cells(x, 1)Row
Cells(x, 4) = Cells(x, 1)Column
End If
Next x
End Sub
Sub macro1()
Dim arr(2), i As Long, j As Long, s() As String
arr(0) = [c1]CurrentRegion
arr(1) = [q1]CurrentRegion
arr(2) = [ai1]CurrentRegion
For i = 0 To 2
ReDim s(1 To UBound(arr(i)))
For j = 1 To UBound(arr(i))
s(j) = Join(ApplicationIndex(arr(i), j, 0), " ")
Next
Open "d:\" & i & "txt" For Binary As #1
Put #1, , Join(s, vbCrLf)
Close #1
Shell "notepad d:\" & i & "txt", vbNormalFocus
Next
MsgBox "ok"
End Sub
iRows=activesheetusedrangerowscount\x0d\iColumns=activesheetusedrangeColumnscount\x0d\\x0d\'如果表格前面的几行或几列可能是空的,需要获得最下面的行数和最右面的列数:\x0d\with activesheetusedrange\x0d\ iEndRow=rowscount+row-1\x0d\ iEndColumn=Columnscount+column-1\x0d\end with
以上就是关于如何用VBA获取某字符所处的列数全部的内容,包括:如何用VBA获取某字符所处的列数、用VBA代码获取一个文本内的指定列的数据、如何再VBA里获取当前工作表里数据的行数和列数等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)