I have a Powershell script to incorporate into an Excel VBA macro. Please reference this question: Powershell Regex: Replace only multiple spaces with tabs
This is the c
You just need to define parameters at the top of your script:
param([string]$path)
$content = [IO.File]::ReadAllText($path)
# etc.
In VBA, you need to pass the parameter:
Shell("powershell.exe -ExecutionPolicy Unrestricted -File <pathname>\Convert_To_Tab_Delimited.ps1 -path """ & pathVariable & """", 1)