Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Convert A1 value to a sheet name and copy to it

I bit off more than I can chew trying to offer a solution in another forum and no one seems to respond there.

Sheet1 cell A1 = 1/7/2013 (mmddyyyy)
How can I convert that value to "January 2013" and insert it in the copy code below to make:

Option Explicit
Sub AtoCPaste()
Range("A1,A3,A5").Copy
Sheets("Sheet3").Range("C1000").End(xlUp).Offset(1 , 0).PasteSpecial
End Sub

To read:

Option Explicit
Sub AtoCPaste()
Range("A1,A3,A5").Copy
Sheets("January 2013").Range("C1000").End(xlUp).Offset(1, 0).PasteSpecial
End Sub

Other A1 entries may be different months in 2013.
Sheets named January 2013 thru December 2013 already exist in the workbook.

Thanks,
Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Convert A1 value to a sheet name and copy to it

Hi Howard,

Am Sat, 12 Jan 2013 00:48:20 -0800 (PST) schrieb Howard:

Option Explicit
Sub AtoCPaste()
Range("A1,A3,A5").Copy
Sheets("January 2013").Range("C1000").End(xlUp).Offset(1, 0).PasteSpecial
End Sub


try:
Sub AtoCPaste()
Dim shName As String

With Sheets("Sheet1")
shName = Format(.Range("A1"), "MMMM YYYY")
.Range("A1,A3,A5").Copy
Sheets(shName).Range("C1000").End(xlUp).Offset(1, 0).PasteSpecial
End With
End Sub

Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Convert A1 value to a sheet name and copy to it

On Saturday, January 12, 2013 1:55:22 AM UTC-8, Claus Busch wrote:
Hi Howard,



Am Sat, 12 Jan 2013 00:48:20 -0800 (PST) schrieb Howard:



Option Explicit


Sub AtoCPaste()


Range("A1,A3,A5").Copy


Sheets("January 2013").Range("C1000").End(xlUp).Offset(1, 0).PasteSpecial


End Sub




try:

Sub AtoCPaste()

Dim shName As String



With Sheets("Sheet1")

shName = Format(.Range("A1"), "MMMM YYYY")

.Range("A1,A3,A5").Copy

Sheets(shName).Range("C1000").End(xlUp).Offset(1, 0).PasteSpecial

End With

End Sub



Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


Wow, what could be better than that? And when I see the solution it seems so simple.

I will include your name in credit for what appears to be "hands tied behind your back and blindfolded easy" for you when I post it in the other forum.
(And to my archives)

Thanks again.

Regards,
Howard
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
Convert config file, copy to new sheet while making some changes, may include variabl kldailey Excel Programming 0 September 12th 12 04:57 PM
Help: auto-copy entire rows from 1 sheet (based on cell criteria) to another sheet. bertbarndoor Excel Programming 4 October 5th 07 04:00 PM
does any one know how to convert a scanned sheet to a work sheet bigjoe44 Charts and Charting in Excel 1 January 2nd 06 12:40 PM
Convert a UDF to it's value when copy sheet Casey[_35_] Excel Programming 8 November 25th 05 09:32 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM


All times are GMT +1. The time now is 01:06 AM.

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"