[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Why can you not do 'ws1.Rows("B10:C1000").Delete'

Posted on 2012-08-12
1
Medium Priority
?
302 Views
Last Modified: 2012-08-12
Hello,

I am trying to delete an area on a worksheet like this

ws1.Rows("B10:C1000").Delete

How can I achieve this correclty?

I would like to delete the contents of the area between B10 and C1000?

:)
0
Comment
Question by:gisvpn
1 Comment
 
LVL 24

Accepted Solution

by:
Steve earned 2000 total points
ID: 38285771
need Range not Rows and ClearContents not Delete

ws1.range("B10:C1000").clearcontents

Rows is only for entire Rows
Delete will remove the cells.. which can shift stuff about.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question