简体   繁体   中英

VBA how to remove string line in pragraph?

For example , i want to remove all string in line 10 below . What the VBA code can be use?

  1. Limitation: Quality metrics are not available
  2. Limitation Cause: HTTPS connection
  3. Service Bearer: Lte
  4. Data Radio Bearer: LTE
  5. Impairment free: Yes
  6. Is Multi RAB: No
  7. LTE Serving Cell Count Average: 1
  8. Number Of Video Session Interruptions: 0
  9. Maximum Duration Of Video Session Interruptions: 0.0 s
  10. Total Duration Of Video Session Interruptions: 0.0 s
  11. Clip Length: 100.704 s

The simplest approach is to go to menu Developer, click "Record macro" and do the action you want to do (that is remove string in row 10). Then you click "stop recording", click "Macros", select Macro1 and click the button Edit. A new window opens with VBA code that does what you just recorded. In your case the code is

Sub Macro1()
  Range("A10").Select
  Selection.ClearContents
End Sub

This is where you start. Then you can play with the code and further adjust it to your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM