Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default re : Copying a range from WB01 and pasting to WB02

macros as below :-

Private Sub MODA()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Set WB1 = Workbooks("A HSA Daily Yield VPB")
Set WB2 = Workbooks("A HSA Daily Scrap VPB")
Set SH1 = WB1.Sheets("Date Input")
Set SH2 = WB2.Sheets("Date Input")
Set SH3 = WB1.Sheets("FI")
Set SH4 = WB1.Sheets("FID")
Set SH5 = WB2.Sheets("Modular")
Set rng1 = SH1.Range("E13")
Set rng2 = SH2.Range("D18")

SH3.Activate
ActiveSheet.Range(rng1 & "116").Copy
SH5.Activate
ActiveSheet.Range(rng2 & "3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

With the above, I am able to copy the WB1.range 116 and paste on WB2.range 3,
I would to copy from WB1.range 116 to 120 at 1 go, and paste on WB2.range 3,
is there any way or shorter script instead of me repeating the copy paste
script 5 times to copy 116 to 120.

Appreciate your help. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default re : Copying a range from WB01 and pasting to WB02

You can put this thing in for loop, probably yo may need 2 for loops and then
increment the rows/column within one of the loop, and other loop to run it 5
times.
Hope this makes sense
--
"Who will guard the guards?"


"ddiicc" wrote:

macros as below :-

Private Sub MODA()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Set WB1 = Workbooks("A HSA Daily Yield VPB")
Set WB2 = Workbooks("A HSA Daily Scrap VPB")
Set SH1 = WB1.Sheets("Date Input")
Set SH2 = WB2.Sheets("Date Input")
Set SH3 = WB1.Sheets("FI")
Set SH4 = WB1.Sheets("FID")
Set SH5 = WB2.Sheets("Modular")
Set rng1 = SH1.Range("E13")
Set rng2 = SH2.Range("D18")

SH3.Activate
ActiveSheet.Range(rng1 & "116").Copy
SH5.Activate
ActiveSheet.Range(rng2 & "3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

With the above, I am able to copy the WB1.range 116 and paste on WB2.range 3,
I would to copy from WB1.range 116 to 120 at 1 go, and paste on WB2.range 3,
is there any way or shorter script instead of me repeating the copy paste
script 5 times to copy 116 to 120.

Appreciate your help. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default re : Copying a range from WB01 and pasting to WB02

Hmm, Loop...so how do I go about in writing the script?
I am just a beginner though, so do not know much on it. thanks.

"Anand.V.V.N" wrote:

You can put this thing in for loop, probably yo may need 2 for loops and then
increment the rows/column within one of the loop, and other loop to run it 5
times.
Hope this makes sense
--
"Who will guard the guards?"


"ddiicc" wrote:

macros as below :-

Private Sub MODA()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Set WB1 = Workbooks("A HSA Daily Yield VPB")
Set WB2 = Workbooks("A HSA Daily Scrap VPB")
Set SH1 = WB1.Sheets("Date Input")
Set SH2 = WB2.Sheets("Date Input")
Set SH3 = WB1.Sheets("FI")
Set SH4 = WB1.Sheets("FID")
Set SH5 = WB2.Sheets("Modular")
Set rng1 = SH1.Range("E13")
Set rng2 = SH2.Range("D18")

SH3.Activate
ActiveSheet.Range(rng1 & "116").Copy
SH5.Activate
ActiveSheet.Range(rng2 & "3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

With the above, I am able to copy the WB1.range 116 and paste on WB2.range 3,
I would to copy from WB1.range 116 to 120 at 1 go, and paste on WB2.range 3,
is there any way or shorter script instead of me repeating the copy paste
script 5 times to copy 116 to 120.

Appreciate your help. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default re : Copying a range from WB01 and pasting to WB02

A for loop is simple loop,
which would look like this
for i=0 to 10
for j=1 to 20
next j
next i
I will do one thing I'll try the code and try to post it.
Anand
--
"Who will guard the guards?"


"ddiicc" wrote:

Hmm, Loop...so how do I go about in writing the script?
I am just a beginner though, so do not know much on it. thanks.

"Anand.V.V.N" wrote:

You can put this thing in for loop, probably yo may need 2 for loops and then
increment the rows/column within one of the loop, and other loop to run it 5
times.
Hope this makes sense
--
"Who will guard the guards?"


"ddiicc" wrote:

macros as below :-

Private Sub MODA()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Set WB1 = Workbooks("A HSA Daily Yield VPB")
Set WB2 = Workbooks("A HSA Daily Scrap VPB")
Set SH1 = WB1.Sheets("Date Input")
Set SH2 = WB2.Sheets("Date Input")
Set SH3 = WB1.Sheets("FI")
Set SH4 = WB1.Sheets("FID")
Set SH5 = WB2.Sheets("Modular")
Set rng1 = SH1.Range("E13")
Set rng2 = SH2.Range("D18")

SH3.Activate
ActiveSheet.Range(rng1 & "116").Copy
SH5.Activate
ActiveSheet.Range(rng2 & "3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

With the above, I am able to copy the WB1.range 116 and paste on WB2.range 3,
I would to copy from WB1.range 116 to 120 at 1 go, and paste on WB2.range 3,
is there any way or shorter script instead of me repeating the copy paste
script 5 times to copy 116 to 120.

Appreciate your help. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default re : Copying a range from WB01 and pasting to WB02

Thanks alot, greatly appreciated your help .. and waiting promptly for the
codes.. thanks.

"Anand.V.V.N" wrote:

A for loop is simple loop,
which would look like this
for i=0 to 10
for j=1 to 20
next j
next i
I will do one thing I'll try the code and try to post it.
Anand
--
"Who will guard the guards?"


"ddiicc" wrote:

Hmm, Loop...so how do I go about in writing the script?
I am just a beginner though, so do not know much on it. thanks.

"Anand.V.V.N" wrote:

You can put this thing in for loop, probably yo may need 2 for loops and then
increment the rows/column within one of the loop, and other loop to run it 5
times.
Hope this makes sense
--
"Who will guard the guards?"


"ddiicc" wrote:

macros as below :-

Private Sub MODA()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
Set WB1 = Workbooks("A HSA Daily Yield VPB")
Set WB2 = Workbooks("A HSA Daily Scrap VPB")
Set SH1 = WB1.Sheets("Date Input")
Set SH2 = WB2.Sheets("Date Input")
Set SH3 = WB1.Sheets("FI")
Set SH4 = WB1.Sheets("FID")
Set SH5 = WB2.Sheets("Modular")
Set rng1 = SH1.Range("E13")
Set rng2 = SH2.Range("D18")

SH3.Activate
ActiveSheet.Range(rng1 & "116").Copy
SH5.Activate
ActiveSheet.Range(rng2 & "3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

With the above, I am able to copy the WB1.range 116 and paste on WB2.range 3,
I would to copy from WB1.range 116 to 120 at 1 go, and paste on WB2.range 3,
is there any way or shorter script instead of me repeating the copy paste
script 5 times to copy 116 to 120.

Appreciate your help. Thanks.

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
Copying formulas in range and pasting in a selection Billy B Excel Worksheet Functions 3 April 17th 09 06:52 PM
Copying and pasting from a range John Excel Worksheet Functions 3 June 6th 07 05:22 PM
copying and pasting range problem Henrik Excel Programming 1 November 15th 05 01:49 PM
Problem copying range and pasting to multiple sheets Murphy Excel Programming 1 October 9th 03 07:13 PM
Finding a range for Copying & Pasting John R[_3_] Excel Programming 1 August 19th 03 03:54 PM


All times are GMT +1. The time now is 11:23 PM.

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"