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

Is it possible to have a macro start at a cell in the next empty row?? The
number of rows change in my report and each time the macro runs it would need
to navigate to the first cell in the first available row. I'm not sure if
this is possible or not??

Thanks!!
Kelley
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Macro question

Sub Way()
Dim LastRow as Long
LastRow = ActiveWorkbook.Worksheets(1).Cells(Rows.Count,1).E nd(xlup).Row

Range("A" & LastRow).Select
End Sub



"Kell2604" wrote:

Is it possible to have a macro start at a cell in the next empty row?? The
number of rows change in my report and each time the macro runs it would need
to navigate to the first cell in the first available row. I'm not sure if
this is possible or not??

Thanks!!
Kelley

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default Macro question

Reduex....

Option Explicit

Sub Way()
Dim LastRow As Long
LastRow = ActiveWorkbook.Worksheets(1) _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Range("A" & LastRow).Select
'Call your Macro here
End Sub

"Kell2604" wrote:

Is it possible to have a macro start at a cell in the next empty row?? The
number of rows change in my report and each time the macro runs it would need
to navigate to the first cell in the first available row. I'm not sure if
this is possible or not??

Thanks!!
Kelley

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Macro question

Thanks for your help. I have just now gotten around to implementing this and
am having a little trouble. I need to paste my data in the first empty cell
in column B. How do I get the code to not just find the first empty cell but
then to move over 1 column before pasting.

When I run it as it is...it navigates to a cell in the middle of all of my
current data. (A31 to be exact), not to the 1st empty cell. The first empty
cell would be A287

Thanks again!!

"Office_Novice" wrote:

Reduex....

Option Explicit

Sub Way()
Dim LastRow As Long
LastRow = ActiveWorkbook.Worksheets(1) _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Range("A" & LastRow).Select
'Call your Macro here
End Sub

"Kell2604" wrote:

Is it possible to have a macro start at a cell in the next empty row?? The
number of rows change in my report and each time the macro runs it would need
to navigate to the first cell in the first available row. I'm not sure if
this is possible or not??

Thanks!!
Kelley

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Macro question

Hi

Try this:


Sub Way()
Dim LastRow As Long
Dim TargetSheet As String

TargetSheet = "Sheet1" ' Change to suit
LastRow = ActiveWorkbook.Worksheets(TargetSheet) _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Worksheets(TargetSheet).Range("B" & LastRow).Select
'Call your Macro here
End Sub

Regards,
Per

"Kell2604" skrev i meddelelsen
...
Thanks for your help. I have just now gotten around to implementing this
and
am having a little trouble. I need to paste my data in the first empty
cell
in column B. How do I get the code to not just find the first empty cell
but
then to move over 1 column before pasting.

When I run it as it is...it navigates to a cell in the middle of all of my
current data. (A31 to be exact), not to the 1st empty cell. The first
empty
cell would be A287

Thanks again!!

"Office_Novice" wrote:

Reduex....

Option Explicit

Sub Way()
Dim LastRow As Long
LastRow = ActiveWorkbook.Worksheets(1) _
.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

Range("A" & LastRow).Select
'Call your Macro here
End Sub

"Kell2604" wrote:

Is it possible to have a macro start at a cell in the next empty row??
The
number of rows change in my report and each time the macro runs it
would need
to navigate to the first cell in the first available row. I'm not sure
if
this is possible or not??

Thanks!!
Kelley


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
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
Macro Question Carl Excel Worksheet Functions 5 February 10th 07 06:51 PM
MACRO Question louisjc Excel Programming 4 September 2nd 06 10:51 PM
Macro Question Me Excel Programming 5 March 4th 05 07:43 PM
macro question wooo Excel Programming 1 June 27th 04 01:30 PM


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