windows - Excel VBA to get UNC from cell and open it in explorer.exe -


i have file list of pc hostnames want able connect c drive of specific 1 clicking in cell or button or something.

let's have hostname in column a. use concatenate turn proper network path \\hostname\c$ , put in column b.

now how can make can click on cell in column b open location in explorer.exe? have 450 pcs need able specify range, feed network path vba , open in explorer.exe make sense? :p

would really, appreciate help. thanks.

wrap concatenated value in "hyperlink()". on clickable , open explorer.

=hyperlink(concatenate("\\";a1;"\c$");a1) 

or put code in worksheet code pane , double click cells, links stand. mustnt use in combination hyperlink.

private sub worksheet_beforedoubleclick(byval target range, cancel boolean) if target.column <> 2 exit sub dim sh object set sh = createobject("wscript.shell") sh.run ("explorer " & target.value) cancel = true end sub 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -