Created
August 27, 2014 09:35
-
-
Save hemge/5b94d82a149312617116 to your computer and use it in GitHub Desktop.
行頭のスペースを削除するExcelマクロ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub ltrim_excel() | |
| Dim objRE | |
| Dim strText | |
| Dim strRes | |
| Dim r | |
| Set objRE = CreateObject("VBScript.RegExp") | |
| objRE.Pattern = "^ " | |
| For Each r In ActiveSheet.UsedRange | |
| If objRE.Test(r.Value) Then r.Value = LTrim(r.Value) | |
| Next r | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment