在我的 Excel 作業表中,我有一個帶有檔案夾影像的單元格。單擊時,我啟動一個宏,要求選擇檔案夾。該部分作業正常,但我想在影像旁邊的單元格中寫入檔案夾路徑。我的問題是,當用戶單擊影像時,單元格選擇不會改變。所以沒有辦法知道 ActiveCell.Address 的位置并選擇 .Next 到它旁邊。即使選擇沒有改變,有沒有辦法實際獲得用戶點擊的位置?
謝謝你。
uj5u.com熱心網友回復:
嘗試這個:
With ThisWorkbook.Sheets("Sheet1")
buttonName = .Shapes(Application.Caller).name
row = .Shapes(buttonName).TopLeftCell.row
col = .Shapes(buttonName).TopLeftCell.col
End With
Dim cell As Range
cell = ActiveSheet.Cells(row, col)
cell.Offset(1, 0).Value = 'your_folder_path_here'
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/492085.html
