Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default copying values in range

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copying values in range

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default copying values in range

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default copying values in range

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copying values in range


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default copying values in range

Dear Mr Kraljb,

Thanks a lot. It works nice.


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
SUMPRODUCT or SUMIF if any values in a range equal any values in another range PCLIVE Excel Worksheet Functions 3 July 15th 09 07:43 PM
Copying Range Names and values from one tab to another Rob Slagle[_3_] Excel Programming 1 August 9th 05 07:12 PM
Copying a range of values between worksheets Christopher R. Lee Excel Programming 2 February 6th 05 09:08 PM
Searching a range and copying values into a new range.... **Please help** :( Lancia Excel Programming 1 September 29th 04 01:08 PM
Copying a particular range of values from one sheet to another in excel anoop_2000 Excel Programming 2 June 17th 04 03:46 AM


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