Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jim G
 
Posts: n/a
Default Changing target sheet name wihtin a macro

I have a macro that copies the total value of a kist that changes daily. The
result is copied to the active cell in another sheet as a value only.

I start a new sheet each month and need to change the target sheet name by
editing the macro each month. How do I have the macro recognise the current
sheet as well as the current cell?

Sheets("OS CHQS").Select
Range("A49").Select
Selection.Copy
Sheets("Jan05").Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--

Youre help is appreciated.
Jim
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default Changing target sheet name wihtin a macro

Sheets("OS CHQS").Select
Range("A49").Select
Selection.Copy
Sheets(format(Date,"mmmyy")).Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False




--
Regards,
Tom Ogilvy




"Jim G" wrote in message
...
I have a macro that copies the total value of a kist that changes daily.

The
result is copied to the active cell in another sheet as a value only.

I start a new sheet each month and need to change the target sheet name by
editing the macro each month. How do I have the macro recognise the

current
sheet as well as the current cell?

Sheets("OS CHQS").Select
Range("A49").Select
Selection.Copy
Sheets("Jan05").Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--

Youre help is appreciated.
Jim



  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim G
 
Posts: n/a
Default Changing target sheet name wihtin a macro

Tom,
I tried this and the macro has no visible effect other than to place the
cursor in cell A2 of the current sheet.

I'm not sure what the 'Sheets(format(Date,"mmmyy"))' actually does.

The problem I think I need solved is, how do I set the active sheet and cell
as the one into which I want the information copied into from the source
sheet without needing to edit the sheet name in the macro to the new month.

Note also that the old month sheet will be used in the first couple of days
of the new month to clsoe out the previous months transactions. So if
"mmmyy" is intended to use teh default system date information, it won't work
on these days.

Thanks
Jim


--
Jim


"Tom Ogilvy" wrote:

Sheets("OS CHQS").Select
Range("A49").Select
Selection.Copy
Sheets(format(Date,"mmmyy")).Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks:=False, _
Transpose:=False




--
Regards,
Tom Ogilvy




"Jim G" wrote in message
...
I have a macro that copies the total value of a kist that changes daily.

The
result is copied to the active cell in another sheet as a value only.

I start a new sheet each month and need to change the target sheet name by
editing the macro each month. How do I have the macro recognise the

current
sheet as well as the current cell?

Sheets("OS CHQS").Select
Range("A49").Select
Selection.Copy
Sheets("Jan05").Select
ActiveCell.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
--

Youre help is appreciated.
Jim




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 Macro values to new sheet Crowbar via OfficeKB.com New Users to Excel 0 December 20th 05 10:10 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Using a macro how do I group every sheet within a book? Pank Mehta Excel Discussion (Misc queries) 3 March 17th 05 06:44 PM
Macro for changing print settings Bill Excel Discussion (Misc queries) 3 December 3rd 04 10:49 PM


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