Author Archives: tabcom

Excel VBA example

 'Select cells and copy
 Range("I2:L14").Select
 Selection.Copy
 
 'Create new sheet and rename
 Sheets.Add After:=ActiveSheet
 ActiveSheet.Name = Format(Now(), "dd-MM-yy hh-mm-ss")
 
 'Paste
 Selection.PasteSpecial Paste:=xlPasteAll
 Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
 Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
 
 'Cleanup
 Sheets(1).Select
 
 Range("E1").ClearContents
 Range("B4:B5").ClearContents

 Range("A1").Select
Excel VBA example was last modified: July 25th, 2018 by tabcom

Move files into folders

I have a set of files:

.\Cat.txt

.\Dog.txt

I want to end up with this:

.\Cat\Cat.txt

.\Dog\Dog.txt

Solution:

for %i in (*) do md "%~ni"

for %i in (*) do move "%i" "%~ni"
Move files into folders was last modified: May 15th, 2018 by tabcom