Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default find next unused row

Hi
iam new to Visual Basic. I have a macro that performs some
calculations and outputs the results into excel 2000.
how do i make visual basic put the results in the next unused row
whenever the macro is run.
please post any links if this might have been explained before.

Thanks

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default find next unused row

Formula (Array - Ctrl-Shift-Enter

= ADDRESS(ROW(OFFSET( $A$1,COUNTA($A$1:$A$65000),0)),COLUMN(OFFSET(
$A$1,COUNTA( $A$1:$A$65000),0)))

or
Macro:

Sub NextBlankDown()
Range("a1").Activate
If ActiveCell.End(xlDown).Row = Rows.Count Then Exit Sub
MsgBox (ActiveCell.End(xlDown).Offset(1, 0).Address)
End Sub

Don Pistulka

"Mike" wrote in message
om...
Hi
iam new to Visual Basic. I have a macro that performs some
calculations and outputs the results into excel 2000.
how do i make visual basic put the results in the next unused row
whenever the macro is run.
please post any links if this might have been explained before.

Thanks

Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default find next unused row

Mike,

This macro takes the entire first row on the active sheet and copies it to
the first blank row on sheet2.

Sub test1()
Cells(1, 1).EntireRow.Copy
Destination:=Sheets("sheet2").Range("a65536").End( xlUp).Offset(1, 0)
End Sub

Don Pistulka
"Don P" wrote in message
...
Formula (Array - Ctrl-Shift-Enter

= ADDRESS(ROW(OFFSET( $A$1,COUNTA($A$1:$A$65000),0)),COLUMN(OFFSET(
$A$1,COUNTA( $A$1:$A$65000),0)))

or
Macro:

Sub NextBlankDown()
Range("a1").Activate
If ActiveCell.End(xlDown).Row = Rows.Count Then Exit Sub
MsgBox (ActiveCell.End(xlDown).Offset(1, 0).Address)
End Sub

Don Pistulka

"Mike" wrote in message
om...
Hi
iam new to Visual Basic. I have a macro that performs some
calculations and outputs the results into excel 2000.
how do i make visual basic put the results in the next unused row
whenever the macro is run.
please post any links if this might have been explained before.

Thanks

Mike





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
Find column letter of the first unused cell John Excel Worksheet Functions 2 May 10th 09 09:06 PM
Copying to next unused row Ken[_2_] Excel Worksheet Functions 5 June 24th 08 08:11 AM
Finding the last unused row in a column rojobrown Excel Worksheet Functions 8 October 7th 06 01:20 PM
what to do with unused cells B Excel Worksheet Functions 1 June 22nd 06 12:09 AM
Eliminate unused columns jlbreyer Excel Discussion (Misc queries) 3 June 20th 05 07:16 PM


All times are GMT +1. The time now is 10:45 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"