Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am having a workbook containing 12 worksheets one for each month. The closing balance of each month is to be copied as opening balance of the following month with values only. (Range g9: g195).I have tried to record a macro for this task but to no avail. The data has to be copied to Range ( E9 : E195). Any gentleman in the community may give an idea to accomplish this task? Whether this code can be used to copy any range to any range (with values only). |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
worksheets("Feb").Range("E9:E195").Value = _
worksheets("Jan").Range("G9:G195").Value will do it. -- Regards, Tom Ogilvy "srinivasan" wrote in message ... Hi, I am having a workbook containing 12 worksheets one for each month. The closing balance of each month is to be copied as opening balance of the following month with values only. (Range g9: g195).I have tried to record a macro for this task but to no avail. The data has to be copied to Range ( E9 : E195). Any gentleman in the community may give an idea to accomplish this task? Whether this code can be used to copy any range to any range (with values only). |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Mr Tom,
I have tried your code. But it is not working for me. Pl explain me again with detailed procedures to be adopted since I am new to VBA |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
See David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/getstarted.htm http://www.mvps.org/dmcritchie/excel....htm#tutorials the VBA tutorial links are after the excel tutorial links. -- Regards, Tom Ogilvy "srinivasan" wrote in message ... Dear Mr Tom, I have tried your code. But it is not working for me. Pl explain me again with detailed procedures to be adopted since I am new to VBA |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub Open_To_Close() Dim ClosingRange As Range Dim OpeningRange As Range Set ClosingRange = ActiveSheet.Range("g5:g195") Set OpeningRange = Worksheets(ActiveSheet.Index + 1).Range("e5:e195") OpeningRange.Value = ClosingRange.Value End Sub Just run it ONLY when you are on the previous month (i.e. the month with the closing range.) This is also assuming that your tabs are in order of months. -- kraljb ------------------------------------------------------------------------ kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955 View this thread: http://www.excelforum.com/showthread...hreadid=399037 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Mr Kraljb,
Thanks a lot. It works nice. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUMPRODUCT or SUMIF if any values in a range equal any values in another range | Excel Worksheet Functions | |||
Copying Range Names and values from one tab to another | Excel Programming | |||
Copying a range of values between worksheets | Excel Programming | |||
Searching a range and copying values into a new range.... **Please help** :( | Excel Programming | |||
Copying a particular range of values from one sheet to another in excel | Excel Programming |