close
Blogtrottr
批踢踢實業坊 ask 板
 
[請問] Excel使用VBA清除儲存格值的方法 已解!
Oct 22nd 2014, 10:06, by Dora

作者Dora (小叮噹)

看板ask

標題[請問] Excel使用VBA清除儲存格值的方法

時間Wed Oct 22 10:06:15 2014

================================================================ 忽然解決了! 結果自己忽然發現我居然少訂了範圍 我犯傻了... 只要用 Range("B2:C3").ClearContents 就好了 ================================================================= 各位高手大家早安 想請教一下EXCEL VBA的問題 假設我有一格合併儲存格的範圍是B2:C3 按了合併之後儲存格名稱就會叫做B2 如圖 http://i.imgur.com/7ZEuUjD.jpg
那麼我想要用VBA來刪除這格儲存格的值 一般我就直接使用以下這個方法 '----------------------- Range("B2").Select Selection.ClearContents '----------------------- 但是當要刪除的儲存格很多的話(超過兩百組的合併儲存格) 畫面會一直點選儲存格然後刪除 除了又慢 畫面也會一直閃爍 所以我就嘗試了 '-------------------------- Range("B2").ClearContents '-------------------------- 這個在一般普通的儲存格沒問題 但是遇到有合併儲存格的 就會顯示錯誤說 "無法改變合併儲存格中的一部份" 如圖 http://i.imgur.com/iNRjecK.jpg
想請問是否還有什麼方法可以快速刪除又不會讓畫面閃爍的語法呢 謝謝大家 -- ▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃ ▃▅▆▆▅▃ ▃▃▃▃▃▃▃▃▃▃▃▃▃▃ ▂▁ ▁ ◢█◤ ◥◤ ▄▂ ▄▂ ●● ▆▅▄▅◣ ◢█▋ │ ▕ ▌ ◥ ▌ ◥_▂▁▂◢ █◤ ●/\● ▕ ▌ ▕ ◢▅◢▆▅▄▅ˍ ╲ˍ'˙ ˍ╱ ˍ _ _ ◣ ▁▂ ˍ  ̄ ◥◤  ̄ ˍ ◥◣ _◣ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.136.31.192 ※ 文章網址: http://www.ptt.cc/bbs/ask/M.1413943579.A.3C5.html ※ 編輯: Dora (223.136.31.192), 10/22/2014 10:12:53

Hevak: 推找到解附上解XD 10/22 10:17

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    gsihop12 發表在 痞客邦 留言(0) 人氣()