-3
A
回答
0
請參考下面的鏈接。這應該是你所追求的。
http://www.excel-vba-easy.com/vba-programming-range-excel-vba.html
0
Omky,
Uyou需要VBA的一些知識呢。 Application.Selection變量返回當前選定的範圍。儘量選擇在您的工作簿的區域,執行下面的宏:
Sub AreaSelected()
MsgBox Application.Selection.Address
End Sub
在這裏,你有一個完整的例子:
http://www.lazerwire.com/2011/10/excel-vba-get-all-selected-rows.html
問候
0
Sub test()
'put something in column 3 of all selected rows
Dim r As Range
For Each r In Selection.Rows
Cells(r.Row, 3) = "test"
Next r
End Sub
相關問題
- 1. 定位單元格的值在Excel VBA
- 2. 在c中訪問Excel單元格值#
- 3. 使用VBA在excel中對單元格內的值進行交換使用VBA
- 4. Excel vba:在從該單元調用的UDF執行之前,是否可以訪問單元格的值?
- 5. excel vba選擇單元格
- 6. Excel VBA:訪問選定列表框行中的單個字段
- 7. Excel VBA,在選定的單元格上執行宏
- 8. 在vba excel中鎖定單元格
- 9. 如何使用VBA從單元格值控制Excel PIVOT表格
- 10. VBA Excel行中的單元格中斷
- 11. Excel Vba:單元格中的公式值
- 12. VBA,Excel - 遍歷篩選列中選定的單元格
- 13. 非常簡單的excel vba宏。指定單元格中的值
- 14. 使用excel VBA顯示相鄰單元格中單元格值的變化
- 15. VBA的Excel - 基於單元格的值
- 16. Excel VBA單元格值不返回值
- 17. VBA Excel單元格引用
- 18. 從給定的單元格中查找表格excel-vba
- 19. 在IE7中使用jquery訪問表格單元格中的值
- 20. 訪問VBA:刪除Excel中的行,其中單元格的值在Access表匹配值
- 21. 設置單元格的值,vba excel
- 22. Excel VBA:用相鄰單元格值填充空單元格
- 23. Excel VBA從篩選範圍中選擇單元格
- 24. Excel VBA:使用xlDown和Offset插入單元格中的值
- 25. 在Excel電子表格中訪問行單元格數量
- 26. VBA在Excel中選擇其他選項卡上的單元格
- 27. 在Excel中選擇具有特定值的單元格的相鄰單元格
- 28. 使用excel VBA在Excel單元格中粘貼excel公式(excel格式)?
- 29. Excel的VBA - 善用列所有選定單元格上雙擊
- 30. 如何刪除空行的Excel單元格中使用VBA
您需要提供更多關於你在做什麼的細節。無論是示例還是屏幕截圖。 – brettdj