Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-08-2010, 10:14 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Smile Auto Update the date.

Hi to @ll,
I have a one querry if any one can solve it I will be very thankful. my querry is that i have a file containing name of co., month statemnt received, stamped & date (on which the statement is received). what i want is that when i write yes in B coloumn of particular co. let say.A Co. which is in cell A6 so that the (yes written in B6) then in cell D6 it should get automatically today's date. I have tried one formula in D coloumn (i.e. if(cell="yes",today(),""), here cell means cell of B coloumn's cell no.). But the problem is that when I open the file next day it recalculate the formula and the date gets change to today's date
(in D coloumn ) where i have mention yes in coloumn B. If any one can write macro in such a way that when i open the file it should not recalculate the formula to those cell of D coloumn which had already returned the date in accordance with the detail in B coloumn.
Attached Files
File Type: xls sample file.xls (22.0 KB, 14 views)

Last edited by Nirik; 12-09-2010 at 09:32 PM.
Reply With Quote
  #2  
Old 12-10-2010, 03:46 PM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
one suggestion to avoid a macro would be that you after entering the yes, steps two cells to the right (= to column D).

In this cell press CTRL and semicolon, which will enter todays date as a fix value in that cell.

Kind regards
Bjorn
Reply With Quote
  #3  
Old 12-10-2010, 03:53 PM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi again,
You can also create this macro yourself !!

Do like this:

Put cursor in cell B6. Start recording a macro (tools / macro / record...). By clicking on a symbol on the little "macro recorder box" (the one with the stop sign) you shift to "relativ references" (which will be needed here).

Type "yes" (without enter), followed by "arrow right" two times. Now you should by in cell D6. Press CTRL + semicolon.

Stop the recording. Your macro is now ready!

A suggestion is that you assign the macro with a shortcut (for example CTRL + Y).

Now you can just place the cursor in column B (B8 for example) and press CTRL+Y and the job is done!

Kind regards
Bjorn
Reply With Quote
  #4  
Old 12-10-2010, 11:46 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default still have a problem

Thanks Bjorn for ur help,
I have created the simple macro as u suggested, but the problem is that when i run the macro by using the shortcut keeping the cursor in B coloumn's (let us take B8 ) cell then this cell's data get's update to yes but the in D coloumn ( i.e D8 ) won't get update to date. plz help...
Reply With Quote
  #5  
Old 12-11-2010, 02:45 AM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi again,
I was in such a hurry before that I didn't check the macro properly

Try this instead (as you see I just quickly edited my previous instruction):

Put cursor in cell B6. Start recording a macro (tools / macro / record...). By clicking on a symbol on the little "macro recorder box" (the one with the stop sign) you shift to "relativ references" (which will be needed here).

Type "yes" (without enter), followed by "arrow right" two times. Now you should by in cell D6.

Now enter the formula =today() in the cell D6. Then (still in D6) run the command "Copy" and after this Edit / Paste special / Values. After this press escape (to hide the area marked for copying).

Stop the recording. Your macro is now ready!

A suggestion is that you assign the macro with a shortcut (for example CTRL + Y).

Now you can just place the cursor in column B (B8 for example) and press CTRL+Y and the job is done!

I really hope it works this time

Kind regards
Bjorn
Reply With Quote
  #6  
Old 12-13-2010, 06:51 AM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default Still Need a help

Thanks Bijorn for ur help,
one more querry that instead of runing macro more often on this file, if u can suggest such thing that when i open the particular file the cell which had returned the date in d column (whatever may be the date) then it should not update the date to today's date. (let say i have mention yes in some cell e.g 10 cells (today), then those 10 cell's d column should show today's date. if I open this file next day then while calculating the formula when u open the file it should ignore those cell in d column which had already mentioned the date)
Thnks Again.....

Last edited by Nirik; 12-13-2010 at 06:53 AM. Reason: spelling mistake
Reply With Quote
  #7  
Old 12-13-2010, 02:32 PM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

HI,
creating such a macro would be quite tricky, and on the top of that, you might be needed to adjust the macro yourself if your cells are moved or extended in any way. It is also a solution which might be a little unsure, since any type of mistake/error/systemproblems etc, might cause the date to change to todays date by "accident".

I am not sure what you want to achieve by your new question. I find it even easier to press "CTRL+Y" in a cell to get the complete job done (including the date), instead of typing "Yes" followed by an enter (and in addition have a really complex macro to maintain/write).

I suggest that you stay with the short and easy macro

Kind regards
Bjorn
Reply With Quote
  #8  
Old 12-13-2010, 09:21 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

Thanks again Bjorn for ur valuable help. This had really helped me.
Reply With Quote
  #9  
Old 12-13-2010, 10:01 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

I have some issue with the macro, after creating macro when i use the shortcut (ctrl+Y, as per ur suggestion) the cell in which the cursor is it update with yes but the D cell of particular row won't get update to the date, instead of that the cursor goes to the cell (in which the today() formula was used n then converted into value while writing macro). so, ultimately while pressing ctrl+y the only B column get update to yes & not the date in d column.
Reply With Quote
  #10  
Old 12-14-2010, 10:07 AM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
I read through my explanation and realized that one small thing was not to 100% clear: After typing =today() in the cell you should hit enter! After this continue with copy... etc.

After you have recorded this macro again, using the clarification above, try it again. If it still doesn't work, publish your recorded macro here and I will hopefully find the error.

You can find the macro details via the menu Tools / Macro / Macro... (or Alt-F8). After this select your macro and click on "Edit". Now you will see the macro and can copy-paste into a reply here.

Kind regards
Bjorn
Reply With Quote
  #11  
Old 12-14-2010, 09:14 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

As per suggestion i have recorded the macro again, but still having problem with the macro. below is the macro
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+y
'
Range("K8").Select
ActiveCell.FormulaR1C1 = "YES"
Range("M8").Select
ActiveCell.FormulaR1C1 = "=TODAY()"
Range("M8").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
Reply With Quote
  #12  
Old 12-15-2010, 11:58 AM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi again,
I have found the error.

After you have started recording the macro, you must follow this instruction carefully (immediately after the start of recording):

By clicking on a symbol on the little "macro recorder box" (the one with the stop sign) you shift to "relativ references" (which will be needed here).

Try this and I am sure it will work!

Rather than sending you a ready-made macro fom the beginning, I wanted you to try it out yourself, making it easier for you to change it in the future (or even create new recorded macros).


Good luck!
Bjorn
Reply With Quote
  #13  
Old 12-15-2010, 09:26 PM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

Hiii Bjorn,
need clarification from ur side.
Reply With Quote
  #14  
Old 12-16-2010, 02:08 AM
BjornS BjornS is offline Auto Update the date. Windows Vista Auto Update the date. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default

Hi,
immediately after the start recording of the macro, you will see a little box showing up on the screen. This box you should click on (see the attached picture).

Kind regards
Bjorn
Attached Images
File Type: jpg Macro-picture1.jpg (76.6 KB, 11 views)
Reply With Quote
  #15  
Old 12-16-2010, 02:35 AM
Nirik's Avatar
Nirik Nirik is offline Auto Update the date. Windows XP Auto Update the date. Office 2007
Smart Novice
Auto Update the date.
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

hats off Buddy,
It works fine, may i know what "relative reference" means in Excel...
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Update the date. Date auto-populates based on checkbox mcarter9000 Word VBA 5 12-23-2010 12:39 PM
Creating an Auto-Calc'd Date? Today+7 Days? SoCalTelephone Word 0 10-06-2010 10:27 AM
Project Auto-Update hB-sys Project 0 04-15-2010 06:46 AM
Auto Update the date. Auto date alarm? markg2 Excel 3 11-18-2009 08:25 AM
new appointment date always reverts back to today's date msills Outlook 0 08-24-2007 08:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft