Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default want to track time while paste value in multiple column of same roe

hi,

I have write a function to track when spreadsheet cell have edited. To achieve this I written below script and it's working fine.
But when I/Team copy paste multiple value then it is not working for all cell only current selected cell reference value(timestamp) updating.

Can you help me what things need to be change to execute function on for more that one selected cells copy/paste value.

Current running code for first scenario is :

function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "TrackTimeStamp" ) { //checks that we're on the correct sheet
var r = s.getActiveCell();
if( r.getColumn() == 2 ) { //checks the column
var nextCell = r.offset(0, 1);
//if( nextCell.getValue() === '' ) //is empty?
var time = new Date();
time = Utilities.formatDate(time, "IST", "HH:mm:ss");
nextCell.setValue(time);
};
};
}
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default want to track time while paste value in multiple column of same roe

hi,

I have write a function to track when spreadsheet cell have edited.
To achieve this I written below script and it's working fine. But
when I/Team copy paste multiple value then it is not working for all
cell only current selected cell reference value(timestamp) updating.

Can you help me what things need to be change to execute function on
for more that one selected cells copy/paste value.

Current running code for first scenario is :

function onEdit() {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "TrackTimeStamp" ) { //checks that we're on the
correct sheet var r = s.getActiveCell();
if( r.getColumn() == 2 ) { //checks the column
var nextCell = r.offset(0, 1);
//if( nextCell.getValue() === '' ) //is empty?
var time = new Date();
time = Utilities.formatDate(time, "IST", "HH:mm:ss");
nextCell.setValue(time);
};
};
}


This script is not VBA and so I assume you're automating Excel via some
other language! Also, doesn't look very efficient to me (based how the
Excel objects can be accessed via the Application object)!<g

It only retrieves the ActiveCell. You need to loop through 'Selection'
to process each cell.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Copy Multiple Columns, Paste Under a Single column Sriram Excel Worksheet Functions 12 April 4th 23 11:37 AM
Search column for date format; cut and paste multiple cells to row above MaryGHunter Excel Programming 1 August 7th 13 07:41 PM
Copy and Paste to multiple woorksheets at one time ManhattanRebel Excel Discussion (Misc queries) 0 February 12th 09 08:16 PM
Can you paste values on multiple worksheets at one time? JanetK Excel Worksheet Functions 1 June 12th 05 04:51 PM
How do I get a hyperlink to track cut and paste data? Kev Nurse Excel Discussion (Misc queries) 2 February 3rd 05 12:40 AM


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