Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to determine the last cell with data in column A then clear
contents from the last three cells in that column. What is a simple way to do that? Thanks.. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Nathan
Try this Sub test() Dim Lr As Long With Sheets("sheet1") Lr = .Range("A" & Rows.Count).End(xlUp).Row ..Range(.Cells(Lr - 2, "A"), .Cells(Lr, "A")).ClearContents End With End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2000-2003) www.rondebruin.nl "Nathan Gutman" wrote in message ... I need to determine the last cell with data in column A then clear contents from the last three cells in that column. What is a simple way to do that? Thanks.. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good Evening Nathan,
A simple one-liner Worksheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(-2, 0).Resize(3, 1).ClearContents -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Nathan Gutman" wrote in message ... I need to determine the last cell with data in column A then clear contents from the last three cells in that column. What is a simple way to do that? Thanks.. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you guys.
On Wed, 25 Feb 2004 20:34:52 -0000, "Bob Phillips" wrote: Good Evening Nathan, A simple one-liner Worksheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(-2, 0).Resize(3, 1).ClearContents |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Bob,
You one-liner worked beautifully! In my case I just used ActiveSheet.Cells(... Would you care to explain what is doing what here. Thanks again, Nathan On Wed, 25 Feb 2004 20:34:52 -0000, "Bob Phillips" wrote: Good Evening Nathan, A simple one-liner Worksheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(-2, 0).Resize(3, 1).ClearContents |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How To Clear Previous Selection From a Drop Down | Excel Discussion (Misc queries) | |||
Transfer a name from one cell to another but leave clear if clear? | Excel Worksheet Functions | |||
clear the clear the web page email attachment lines | Excel Discussion (Misc queries) | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
How do I clear a print area when the selection is grayed out? | Excel Discussion (Misc queries) |