Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Clearing cells

I have the following code to clear columns at a specific cell number
and then all the way down the column, but I get a "invalid or
unqualified reference" error. Why is that? It stops on the .Cells
portion.....

Help?

Sheets("Generator").Select
.Range("b14:b" & .Cells(Rows.Count, "B").End(xlUp).Row).ClearContents
.Range("c14:c" & .Cells(Rows.Count, "C").End(xlUp).Row).ClearContents
.Range("d14:d" & .Cells(Rows.Count, "D").End(xlUp).Row).ClearContents
.Range("e14:e" & .Cells(Rows.Count, "E").End(xlUp).Row).ClearContents
.Range("f14:f" & .Cells(Rows.Count, "F").End(xlUp).Row).ClearContents
.Range("g14:g" & .Cells(Rows.Count, "G").End(xlUp).Row).ClearContents
.Range("i14:i" & .Cells(Rows.Count, "I").End(xlUp).Row).ClearContents

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default Clearing cells

I'm not sure you need the periods before "Range" and "Cells".

Try this:

Sheets("Generator").Select
Range("b14:b" & Cells(Rows.Count, "B").End(xlUp).Row).ClearContents
Range("c14:c" & Cells(Rows.Count, "C").End(xlUp).Row).ClearContents
Range("d14:d" & Cells(Rows.Count, "D").End(xlUp).Row).ClearContents
Range("e14:e" & Cells(Rows.Count, "E").End(xlUp).Row).ClearContents
Range("f14:f" & Cells(Rows.Count, "F").End(xlUp).Row).ClearContents
Range("g14:g" & Cells(Rows.Count, "G").End(xlUp).Row).ClearContents
Range("i14:i" & Cells(Rows.Count, "I").End(xlUp).Row).ClearContents


wrote in message
ups.com...
I have the following code to clear columns at a specific cell number
and then all the way down the column, but I get a "invalid or
unqualified reference" error. Why is that? It stops on the .Cells
portion.....

Help?

Sheets("Generator").Select
.Range("b14:b" & .Cells(Rows.Count, "B").End(xlUp).Row).ClearContents
.Range("c14:c" & .Cells(Rows.Count, "C").End(xlUp).Row).ClearContents
.Range("d14:d" & .Cells(Rows.Count, "D").End(xlUp).Row).ClearContents
.Range("e14:e" & .Cells(Rows.Count, "E").End(xlUp).Row).ClearContents
.Range("f14:f" & .Cells(Rows.Count, "F").End(xlUp).Row).ClearContents
.Range("g14:g" & .Cells(Rows.Count, "G").End(xlUp).Row).ClearContents
.Range("i14:i" & .Cells(Rows.Count, "I").End(xlUp).Row).ClearContents



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clearing cells without clearing formulas marsjune68 Excel Discussion (Misc queries) 2 April 10th 09 07:39 PM
auto clearing cells Yvonne New Users to Excel 1 July 14th 08 10:54 PM
clearing cells Lauren Excel Worksheet Functions 1 September 7th 06 09:41 PM
Clearing Cells mully New Users to Excel 3 May 19th 05 07:12 PM
Clearing cells hal Excel Programming 3 August 8th 03 04:01 PM


All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"