Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clearing cells without clearing formulas | Excel Discussion (Misc queries) | |||
auto clearing cells | New Users to Excel | |||
clearing cells | Excel Worksheet Functions | |||
Clearing Cells | New Users to Excel | |||
Clearing cells | Excel Programming |