Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

clear from current cell down not up

Posted on 2016-11-17
2
Medium Priority
?
28 Views
Last Modified: 2016-11-17
I am using below code when I open file which works fine if there is data but if there is no data in cell B10 it deletes the header row which in in row 9. Can this code be amended to only delete from B10 down and if there is no data in cell do nothing.

Sheets("DD MMM").Range(Range("B10"), Cells(Rows.Count, "M").End(xlUp)).Select

Thanks in advance
0
Comment
Question by:Jagwarman
2 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 41891559
Hi,

pls try

Sheets("DD MMM").Range(Range("B10"), Cells(10, "M").End(xlDown)).Select

Open in new window

Regards
0
 

Author Closing Comment

by:Jagwarman
ID: 41891574
Thanks Rgonzo. I'm gonna miss you :-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

972 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