What is the syntax to clear a range?

'To clear all contents, including styling
Range(“<your range>”).Clear

'To clear only text
Range(“<your range>”).ClearContents
'examples
Range(“D:D”).Clear ‘clears column D
Range(“A2:C5”).Clear ‘clears range A2:C5
Range(“B1:B3”, “D1:E5”).Clear ‘clears multiple ranges
Sheets("Input").Range("pasteRange").ClearContents 'clears text only

 

Advertisements

Published by

Freeworkings

www.freeworkings.com