Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding date to bottom of worksheet

Hello all,

I'm trying to add the current date and some text to the bottom of a
worksheet though the worksheet will have changing numbers of rows. Anyone
know how to do this?

Regards

Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Adding date to bottom of worksheet

On Aug 13, 1:08*pm, CELCAT wrote:
Hello all,

I'm trying to add the current date and some text to the bottom of a
worksheet though the worksheet will have changing numbers of rows. Anyone
know how to do this?

Regards

Chris


Chris,

Can you define "the bottom of a worksheet"? (UsedRange will return
the used range of a worksheet (which you can leverage to get the last
row), going to the last row of a specified column and then doing .End
(xlUp) will get you to the "last" non-empty cell in a column, and
there are other ways depending on what you are trying to accomplish).
Without knowing your definition of "bottom" it's hard to tell what
will be most useful to you.

Best,

Matthew Herbert
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding date to bottom of worksheet

Hi Matthew,

Thanks for the quick response. Sorry for not being clearer.

I'm importing a stored proceedure from SQL and it's populating the worksheet
but I'd like to add the date on one line and some text under it leaving a 1
row space after the last row of data. The trouble I have is that the amount
of data will very so the last row will keep changing. Does that make sense?

Regards

Chris

"Matthew Herbert" wrote:

On Aug 13, 1:08 pm, CELCAT wrote:
Hello all,

I'm trying to add the current date and some text to the bottom of a
worksheet though the worksheet will have changing numbers of rows. Anyone
know how to do this?

Regards

Chris


Chris,

Can you define "the bottom of a worksheet"? (UsedRange will return
the used range of a worksheet (which you can leverage to get the last
row), going to the last row of a specified column and then doing .End
(xlUp) will get you to the "last" non-empty cell in a column, and
there are other ways depending on what you are trying to accomplish).
Without knowing your definition of "bottom" it's hard to tell what
will be most useful to you.

Best,

Matthew Herbert

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Adding date to bottom of worksheet

Give this macro a try...

Sub AddDateAtBottom()
Dim LastUsedRow As Long
With ActiveSheet
LastUsedRow = .Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious).Row
.Cells(LastUsedRow + 2, "A").Value = Date
.Cells(LastUsedRow + 3, "A").Value = "Some additional text"
End With
End Sub

--
Rick (MVP - Excel)


"CELCAT" wrote in message
...
Hi Matthew,

Thanks for the quick response. Sorry for not being clearer.

I'm importing a stored proceedure from SQL and it's populating the
worksheet
but I'd like to add the date on one line and some text under it leaving a
1
row space after the last row of data. The trouble I have is that the
amount
of data will very so the last row will keep changing. Does that make
sense?

Regards

Chris

"Matthew Herbert" wrote:

On Aug 13, 1:08 pm, CELCAT wrote:
Hello all,

I'm trying to add the current date and some text to the bottom of a
worksheet though the worksheet will have changing numbers of rows.
Anyone
know how to do this?

Regards

Chris


Chris,

Can you define "the bottom of a worksheet"? (UsedRange will return
the used range of a worksheet (which you can leverage to get the last
row), going to the last row of a specified column and then doing .End
(xlUp) will get you to the "last" non-empty cell in a column, and
there are other ways depending on what you are trying to accomplish).
Without knowing your definition of "bottom" it's hard to tell what
will be most useful to you.

Best,

Matthew Herbert


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding date to bottom of worksheet

Thanks Rick, works fine.

Thanks also to Matthew for your assistance

"Rick Rothstein" wrote:

Give this macro a try...

Sub AddDateAtBottom()
Dim LastUsedRow As Long
With ActiveSheet
LastUsedRow = .Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious).Row
.Cells(LastUsedRow + 2, "A").Value = Date
.Cells(LastUsedRow + 3, "A").Value = "Some additional text"
End With
End Sub

--
Rick (MVP - Excel)


"CELCAT" wrote in message
...
Hi Matthew,

Thanks for the quick response. Sorry for not being clearer.

I'm importing a stored proceedure from SQL and it's populating the
worksheet
but I'd like to add the date on one line and some text under it leaving a
1
row space after the last row of data. The trouble I have is that the
amount
of data will very so the last row will keep changing. Does that make
sense?

Regards

Chris

"Matthew Herbert" wrote:

On Aug 13, 1:08 pm, CELCAT wrote:
Hello all,

I'm trying to add the current date and some text to the bottom of a
worksheet though the worksheet will have changing numbers of rows.
Anyone
know how to do this?

Regards

Chris

Chris,

Can you define "the bottom of a worksheet"? (UsedRange will return
the used range of a worksheet (which you can leverage to get the last
row), going to the last row of a specified column and then doing .End
(xlUp) will get you to the "last" non-empty cell in a column, and
there are other ways depending on what you are trying to accomplish).
Without knowing your definition of "bottom" it's hard to tell what
will be most useful to you.

Best,

Matthew Herbert



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
Adding Sum to bottom of Col C for all Sheets in Array SITCFanTN Excel Programming 2 July 13th 06 02:02 PM
End (bottom) of worksheet Heidi Excel Worksheet Functions 1 June 8th 06 06:24 PM
Adding in row at bottom of range Graham Haughs Excel Programming 4 March 27th 06 08:03 PM
Adding a worksheet from a date named workbook and save as current Lynn Bales Excel Programming 0 July 20th 05 01:35 PM
Adding info in the row at the bottom using macro? Carrie Excel Discussion (Misc queries) 1 April 14th 05 04:18 PM


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