PC Review


Reply
Thread Tools Rate Thread

Adding date to bottom of worksheet

 
 
CELCAT
Guest
Posts: n/a
 
      13th Aug 2009
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
 
Reply With Quote
 
 
 
 
Matthew Herbert
Guest
Posts: n/a
 
      13th Aug 2009
On Aug 13, 1:08*pm, CELCAT <CEL...@discussions.microsoft.com> 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 With Quote
 
CELCAT
Guest
Posts: n/a
 
      13th Aug 2009
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 <CEL...@discussions.microsoft.com> 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 With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      13th Aug 2009
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" <(E-Mail Removed)> wrote in message
news:3B837924-50CA-4D36-8028-(E-Mail Removed)...
> 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 <CEL...@discussions.microsoft.com> 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 With Quote
 
CELCAT
Guest
Posts: n/a
 
      13th Aug 2009
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" <(E-Mail Removed)> wrote in message
> news:3B837924-50CA-4D36-8028-(E-Mail Removed)...
> > 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 <CEL...@discussions.microsoft.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
End (bottom) of worksheet =?Utf-8?B?SGVpZGk=?= Microsoft Excel Worksheet Functions 1 8th Jun 2006 06:24 PM
Add a row to the bottom of a worksheet. Box666 Microsoft Excel Misc 1 7th Jan 2006 03:48 PM
Adding button to bottom for business contacts vs regular contacts and adding it to my favorites folder boe Microsoft Outlook Contacts 0 10th Nov 2005 03:44 PM
Adding a worksheet from a date named workbook and save as current =?Utf-8?B?THlubiBCYWxlcw==?= Microsoft Excel Programming 0 20th Jul 2005 01:35 PM
where is the bottom of my worksheet? Doc H Microsoft Excel Misc 3 9th Jul 2003 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 AM.