Hello I'd like to clear the contents from lets say the point D2 till the end at the right
I typed this but not working properly...
Could somebody help??
Thanks a lot in advance![]()
Range("D2").End(xlToRight).ClearContents
Hello I'd like to clear the contents from lets say the point D2 till the end at the right
I typed this but not working properly...
Could somebody help??
Thanks a lot in advance![]()
Range("D2").End(xlToRight).ClearContents
Hi,
If the range is contiguous then
if not![]()
Range("D2"),Range("D2").End(xlToRight)).ClearContents
![]()
Range("D2"),Range("D" & Columns.Count).End(xlToLeft)).ClearContents
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
I reckon that should be
and![]()
Range("D2",Range("D2").End(xlToRight)).ClearContents
Range("D2",Range("D" & Columns.Count).End(xlToLeft)).ClearContents[/code]
there's an extra ) in Richard's posted versions
Josie
if at first you don't succeed try doing it the way your wife told you to
@Joseph
Quite correct. Well spotted. That will teach me to check code rather than writing it on the fly![]()
Thanks a lot!!!
It worked!! :-)
Sorry RIchard
But thisStill erases what is on the left :-(![]()
Range("D2"),Range("D2").End(xlToRight)).ClearContents
...but that's what I incorrectly posted and admitted just now.
Have you tried Joseph's correction?
yes and its working :-)
thanks richard and thanks joseph :-)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks