Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Go to first available cell in A.

Simple, but having the hardest time...

Need to go to first available cell in column A, then clear contents of
all columns to the right and rows below.

(Thought I was getting good at this, but got stuck assembling this one
for some reason).
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Go to first available cell in A.

Hi,

Define more clearly what you mean by 'First available cell in Column A'

Mike

"J.W. Aldridge" wrote:

Simple, but having the hardest time...

Need to go to first available cell in column A, then clear contents of
all columns to the right and rows below.

(Thought I was getting good at this, but got stuck assembling this one
for some reason).

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Go to first available cell in A.

Define more clearly what you mean by 'First available cell in Column A'

Good point Mike

This will select the first empty cell in A
This is not always the cell below the last cell with data in A

Sub test()
On Error GoTo BodemUp
Columns("A").Cells.SpecialCells(xlCellTypeBlanks). Cells(1).Select
Exit Sub
BodemUp: Cells(Rows.Count, "A").End(xlUp)(2).Select
End Sub


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mike H" wrote in message ...
Hi,

Define more clearly what you mean by 'First available cell in Column A'

Mike

"J.W. Aldridge" wrote:

Simple, but having the hardest time...

Need to go to first available cell in column A, then clear contents of
all columns to the right and rows below.

(Thought I was getting good at this, but got stuck assembling this one
for some reason).

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Go to first available cell in A.

This one takes me to the last cell used.
I need the cursor to go to the next empty cell.
Then clear everything to the right and below.

Range("A2").Select
Selection.End(xlDown).Select
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Go to first available cell in A.

Hi,

In which case it sounds like you want this

FirstRow = Range("A2").End(xlDown).Row
lastrow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row
Rows(FirstRow & ":" & lastrow).EntireRow.ClearContents


Mike

"J.W. Aldridge" wrote:

This one takes me to the last cell used.
I need the cursor to go to the next empty cell.
Then clear everything to the right and below.

Range("A2").Select
Selection.End(xlDown).Select

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
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options Yuvraj Excel Discussion (Misc queries) 0 June 29th 09 11:20 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Worksheet Functions 1 August 22nd 08 02:04 AM
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 [email protected] Excel Programming 1 August 21st 08 10:13 PM
NEED VBA TO SELECT A CELL; NOTE THE CELL VALUE;COPYADJ CELL;FIND CELL VALUE IN A RANGE AND SO ON CAPTGNVR Excel Programming 2 July 8th 07 04:18 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 04:14 AM.

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"