Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Value & unchanging Date With Macro run


Hi All,
Every other cell in Sheet1 Column A from A6 to A 42 has text/numbers
copied from other workbooks.
The cells are formated as General.

My objective is (in those cells) to have the text or numbers followed
by the Month & Day (two digits each)
when ever the copy/paste macro is run, BUT won't change untill the
copy/paste code is run next week:

IE: if 0453 is pasted to a cell, and date is Janurary 12th, then cell
would display
0453 01/12

Some stuff that don't work:
'ActiveCell.Offset(1, 0).Value = Now
'rng.Offset(1, 0).Value = Now
'rng.Offset(1, 0).Value = "A4" & Now
'rng.Offset(1, 0).Value = A4 & Now & Format("mm/dd")
'rng.Offset(1, 0).Value = ("A4") & (Now & Format("mm/dd"))
'if(a4="",""(a4 & Format(Now, "mm-dd")))

Dont be disillusioned by the offset and stuff, i was concentrating on
the text and date.
I could name the cells for the range, as they are the same cells that
get copied over.
Any direction?


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=503878

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Cell Value & unchanging Date With Macro run

Are you only copying values? Will there ever be formulas?

how about

Dim c as range
For each c in Sheet1.Range("A6:A42")
if c.value<"" then
c.value=c.value & " " & Format(Now,"mm-dd")
end if
Next c

You would run this directly after the copy-paste routine. It might be
better to modify your existing routine, but difficult to suggest how without
seeing it.

Tim

"Desert Piranha"
wrote in
message news:Desert.Piranha.222edm_1137981301.681@excelfor um-nospam.com...

Hi All,
Every other cell in Sheet1 Column A from A6 to A 42 has text/numbers
copied from other workbooks.
The cells are formated as General.

My objective is (in those cells) to have the text or numbers followed
by the Month & Day (two digits each)
when ever the copy/paste macro is run, BUT won't change untill the
copy/paste code is run next week:

IE: if 0453 is pasted to a cell, and date is Janurary 12th, then cell
would display
0453 01/12

Some stuff that don't work:
'ActiveCell.Offset(1, 0).Value = Now
'rng.Offset(1, 0).Value = Now
'rng.Offset(1, 0).Value = "A4" & Now
'rng.Offset(1, 0).Value = A4 & Now & Format("mm/dd")
'rng.Offset(1, 0).Value = ("A4") & (Now & Format("mm/dd"))
'if(a4="",""(a4 & Format(Now, "mm-dd")))

Dont be disillusioned by the offset and stuff, i was concentrating on
the text and date.
I could name the cells for the range, as they are the same cells that
get copied over.
Any direction?


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=503878



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Value & unchanging Date With Macro run


Hi Tim,
Thx for responding. I will check this out and get back as i have to
leave for about an hour.
BUT it will always be values (text or numbers) no formulas.

Thx Again
DaveTim Williams Wrote:
Are you only copying values? Will there ever be formulas?

how about

Dim c as range
For each c in Sheet1.Range("A6:A42")
if c.value<"" then
c.value=c.value & " " & Format(Now,"mm-dd")
end if
Next c

You would run this directly after the copy-paste routine. It might be
better to modify your existing routine, but difficult to suggest how
without
seeing it.

Tim



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=503878

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell Value & unchanging Date With Macro run


Hi Tim,
Ok Its working kinda. Im getting the correct format but this is whats
displaying in the cell:
453 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22
01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22

he he he. i will work on it tonight and see what i can figure out.

Does the fact that is every other cell (or row) have any thing to do
with this result?

Thx much,
Dave
Desert Piranha Wrote:
Hi Tim,
Thx for responding. I will check this out and get back as i have to
leave for about an hour.
BUT it will always be values (text or numbers) no formulas.

Thx Again
Dave



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=503878

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Cell Value & unchanging Date With Macro run

You are running the code only once, after copying all of the values, right?
Also, maybe your "empty" cells aren't really empty.

If you still don't get it working then post your code.

Tim.



"Desert Piranha"
<Desert.Piranha.222j0a_1137987301.2897@excelforu m-nospam.com wrote in
message news:Desert.Piranha.222j0a_1137987301.2897@excelfo rum-nospam.com...

Hi Tim,
Ok Its working kinda. Im getting the correct format but this is whats
displaying in the cell:
453 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22
01-22 01-22 01-22 01-22 01-22 01-22 01-22 01-22

he he he. i will work on it tonight and see what i can figure out.

Does the fact that is every other cell (or row) have any thing to do
with this result?

Thx much,
Dave
Desert Piranha Wrote:
Hi Tim,
Thx for responding. I will check this out and get back as i have to
leave for about an hour.
BUT it will always be values (text or numbers) no formulas.

Thx Again
Dave



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile:
http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=503878



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
Unchanging Cell Color Lavanya Pandian Excel Discussion (Misc queries) 2 November 6th 09 03:46 PM
Unchanging cell question DR Excel Discussion (Misc queries) 4 May 11th 07 11:43 PM
Need the formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
Need Formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
set cell to today's date macro Colm O'Brien Excel Programming 3 May 28th 04 11:56 AM


All times are GMT +1. The time now is 10:54 AM.

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"