#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default plus 1

Hello Experts,

I have an xls worksheet in which users paste a date from another
application.
Once pasted, I want to increase the value by one day (in the same
field).
Is that possible? And if so, how?


alex

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default plus 1

ActiveCell.Value = ActiveCell.Value + 1

--
Regards,
Tom Ogilvy


"alex" wrote:

Hello Experts,

I have an xls worksheet in which users paste a date from another
application.
Once pasted, I want to increase the value by one day (in the same
field).
Is that possible? And if so, how?


alex


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default plus 1

On Jul 13, 1:54 pm, Tom Ogilvy
wrote:
ActiveCell.Value = ActiveCell.Value + 1

--
Regards,
Tom Ogilvy



"alex" wrote:
Hello Experts,


I have an xls worksheet in which users paste a date from another
application.
Once pasted, I want to increase the value by one day (in the same
field).
Is that possible? And if so, how?


alex- Hide quoted text -


- Show quoted text -


thanks Tom for your response.
I want to limit this function to only column B. How would I set that
up, and what Sub would I use?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default plus 1

Try it this way....

If ActiveCell.Column = 2 Then ActiveCell.Value = ActiveCell.Value + 1

Rick


"alex" wrote in message
ups.com...
On Jul 13, 1:54 pm, Tom Ogilvy
wrote:
ActiveCell.Value = ActiveCell.Value + 1

--
Regards,
Tom Ogilvy



"alex" wrote:
Hello Experts,


I have an xls worksheet in which users paste a date from another
application.
Once pasted, I want to increase the value by one day (in the same
field).
Is that possible? And if so, how?


alex- Hide quoted text -


- Show quoted text -


thanks Tom for your response.
I want to limit this function to only column B. How would I set that
up, and what Sub would I use?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default plus 1

On Jul 13, 3:20 pm, "Rick Rothstein \(MVP - VB\)"
wrote:
Try it this way....

If ActiveCell.Column = 2 Then ActiveCell.Value = ActiveCell.Value + 1

Rick

"alex" wrote in message

ups.com...



On Jul 13, 1:54 pm, Tom Ogilvy
wrote:
ActiveCell.Value = ActiveCell.Value + 1


--
Regards,
Tom Ogilvy


"alex" wrote:
Hello Experts,


I have an xls worksheet in which users paste a date from another
application.
Once pasted, I want to increase the value by one day (in the same
field).
Is that possible? And if so, how?


alex- Hide quoted text -


- Show quoted text -


thanks Tom for your response.
I want to limit this function to only column B. How would I set that
up, and what Sub would I use?- Hide quoted text -


- Show quoted text -


Thanks Rick for your help.
I also need to know what Sub you'd use, and if any arguments are
required...unless I'm misunderstanding where to place the code.

alex



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default plus 1

Thanks Rick for your help.
I also need to know what Sub you'd use, and if any arguments are
required...unless I'm misunderstanding where to place the code.


You can probably place it in the Worksheet Change event. Maybe like this...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim CurrentEnableEventsStatus As Boolean
CurrentEnableEventsStatus = Application.EnableEvents
Application.EnableEvents = False
If Target.Column = 2 Then Target.Value = Target.Value + 1
Application.EnableEvents = CurrentEnableEventsStatus
End Sub

Rick
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



All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"