The Smith Posted August 19, 2008 Posted August 19, 2008 Hi everyone, I'm building a very simple agenda in Excel. At the top, I wrote the date and Excel wrote the following ones for me, by dragging it. But then I would like that when I open up the .xlsx doc, today's cell is already selected. So I know this is done using a macro. I'm skilled(a bit) in VB.net, but I never done VBA programming so I just don't know how to start... Share this post Link to post Share on other sites More sharing options...
ARandomOWL Posted August 20, 2008 Posted August 20, 2008 Simple, "ActiveSheet.Cells(5, 4).Select" Edit: More appropriete, ActiveSheet.Range("D5").Select Linky Share this post Link to post Share on other sites More sharing options...
The Smith Posted August 20, 2008 Posted August 20, 2008 Yup I understand how to select a cell, but the part I do not know how is to recognize the dates and to select today's one. Share this post Link to post Share on other sites More sharing options...
ARandomOWL Posted August 20, 2008 Posted August 20, 2008 I think you would be looking for a "for" statement. but i can't find it for excel/VBA right now. Share this post Link to post Share on other sites More sharing options...
Silverfox Posted August 20, 2008 Posted August 20, 2008 It relies on your system clock, so be cautious about that one - it can screw up sometimes. I remember doing this somewhere, but there is a function in Excel that will report today's date and time somewhere, so might be easier to have a hidden cell that auto-updates on opening the spreadsheet and perform some sort of lookup/concatenate on the various bits of data. Share this post Link to post Share on other sites More sharing options...
Crazy_Nate Posted August 20, 2008 Posted August 20, 2008 It relies on your system clock, so be cautious about that one - it can screw up sometimes. I remember doing this somewhere, but there is a function in Excel that will report today's date and time somewhere, so might be easier to have a hidden cell that auto-updates on opening the spreadsheet and perform some sort of lookup/concatenate on the various bits of data. I know that one! =TODAY() or =NOW() Share this post Link to post Share on other sites More sharing options...
ARandomOWL Posted August 20, 2008 Posted August 20, 2008 today() = Todays date now() = date & time Share this post Link to post Share on other sites More sharing options...
Silverfox Posted August 20, 2008 Posted August 20, 2008 Concatenate them both and there you have it. Set a macro to refresh the cell on startup. Share this post Link to post Share on other sites More sharing options...
The Smith Posted August 20, 2008 Posted August 20, 2008 (edited) today() = Todays datenow() = date & time Yup I knew that already. What I didn't was the concatenate part. I'll dig up the online help about that word. Thanks! Edited August 20, 2008 by The Smith Share this post Link to post Share on other sites More sharing options...
Silverfox Posted August 20, 2008 Posted August 20, 2008 Concatenate basically does this: Imagine you have three cells. One says "Boobs" the second says "are" the third says "awesome", concatenate(cell1+cell2+cell3) ... and you get "Boobsareawesome" It shunts words together, but you can play around and separate words with spaces and so forth. Excel can do everything. It once did my laundry. Share this post Link to post Share on other sites More sharing options...
hardnrg Posted August 21, 2008 Posted August 21, 2008 isn't an agenda with today's date highlighted also known as a calendar? Share this post Link to post Share on other sites More sharing options...
Silverfox Posted August 21, 2008 Posted August 21, 2008 isn't an agenda with today's date highlighted also known as a calendar? Indeed! But I'm not sure if you can get Excel to talk to Outlook with VB, lol. Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now