Home Excel VBA using Range with variables

# Excel VBA using Range with variables

Josh
1#
Josh Published in 2018-01-12 17:05:07Z
 I am trying to clear a range of cells with the use of a variable. For some background I have values in A-G that will be updated regularly while the values in I-K need to remain constant. I am trying to use the value stored in myCell (in this example A8) to guide my clear command to be everything from it to G100 Range(myCell, "G100").ClearContents  I have tried several variations of this but it never seems to take so there must be something I am missing. Thanks for looking!
SJR
2#
 You're close. Range(myCell, range("G100")).ClearContents 
 You could: Sub ClearCell() Range("G100").Clear End Sub  or Sub VBA_Clear_Contents_Range() Range("G100").ClearContents End Sub  or Sub DeleteG100() Range("G100").Select Selection.ClearContents end sub  Regards Daniel