#1   Report Post  
Posted to microsoft.public.excel.misc
SR SR is offline
external usenet poster
 
Posts: 18
Default Excel-Macro Problem

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Excel-Macro Problem

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #3   Report Post  
Posted to microsoft.public.excel.misc
SR SR is offline
external usenet poster
 
Posts: 18
Default Excel-Macro Problem

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Excel-Macro Problem

List all instances of Reqn in Sheet3 column A:

Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 formula1 formula2
Req2

Drag down formulae as required!
formula1: =SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)
formula2: =SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)


Regards,
Stefi

€žSR€ ezt Ã*rta:

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #5   Report Post  
Posted to microsoft.public.excel.misc
SR SR is offline
external usenet poster
 
Posts: 18
Default Excel-Macro Problem

Hi,

I need a macro to relect the values in column B of sheet 1 and sheet 2 to be
incorporated without duplicates in column A of sheet3.This needs to be done
along with the summation of values from column L of sheet1 and sheet2 in to
sheet3(column B and column C).

Pls help!!


"Stefi" wrote:

List all instances of Reqn in Sheet3 column A:

Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 formula1 formula2
Req2

Drag down formulae as required!
formula1: =SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)
formula2: =SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)


Regards,
Stefi

€žSR€ ezt Ã*rta:

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Excel-Macro Problem

Here you a

Sub test()
Worksheets("Sheet1").Range("A1").Value = "reqslist"
Worksheets("Sheet2").Range("A1").Value = "reqslist"
lastr_sh1 = Worksheets("Sheet1").Columns("A:A").End(xlDown).Ro w
lastr_sh2 = Worksheets("Sheet2").Columns("A:A").End(xlDown).Ro w
Worksheets("Sheet1").Range("A2:A" & lastr_sh1).Copy
Destination:=Worksheets("Sheet3").Range("A2")
Worksheets("Sheet2").Range("A2:A" & lastr_sh2).Copy
Destination:=Worksheets("Sheet3").Range("A" & lastr_sh1 + 1)
Worksheets("Sheet3").Select
Range("A1").Value = "reqslist"
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Columns("A:A").Select
Range("A1:A" & lastr_sh3).AdvancedFilter Action:=xlFilterInPlace,
Unique:=True
Selection.CurrentRegion.Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveSheet.ShowAllData
Columns("A").Delete
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Range("B2").Formula = "=SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)"
Range("C2").Formula = "=SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)"
Range("B2:C2").AutoFill Destination:=Range("B2:C" & lastr_sh3),
Type:=xlFillDefault
End Sub

Regards,
Stefi


€žSR€ ezt Ã*rta:

Hi,

I need a macro to relect the values in column B of sheet 1 and sheet 2 to be
incorporated without duplicates in column A of sheet3.This needs to be done
along with the summation of values from column L of sheet1 and sheet2 in to
sheet3(column B and column C).

Pls help!!


"Stefi" wrote:

List all instances of Reqn in Sheet3 column A:

Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 formula1 formula2
Req2

Drag down formulae as required!
formula1: =SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)
formula2: =SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)


Regards,
Stefi

€žSR€ ezt Ã*rta:

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #7   Report Post  
Posted to microsoft.public.excel.misc
SR SR is offline
external usenet poster
 
Posts: 18
Default Excel-Macro Problem

Thanks Stefi,

But could u give me a genaralized (which can have any value for data)
function which meets the following requirements:

Sheet1 --values start from B6, L6
Sheet2---values start from B24, L24

Output Sheet
Sheet3--values start from A2, B2,C2






"Stefi" wrote:

Here you a

Sub test()
Worksheets("Sheet1").Range("A1").Value = "reqslist"
Worksheets("Sheet2").Range("A1").Value = "reqslist"
lastr_sh1 = Worksheets("Sheet1").Columns("A:A").End(xlDown).Ro w
lastr_sh2 = Worksheets("Sheet2").Columns("A:A").End(xlDown).Ro w
Worksheets("Sheet1").Range("A2:A" & lastr_sh1).Copy
Destination:=Worksheets("Sheet3").Range("A2")
Worksheets("Sheet2").Range("A2:A" & lastr_sh2).Copy
Destination:=Worksheets("Sheet3").Range("A" & lastr_sh1 + 1)
Worksheets("Sheet3").Select
Range("A1").Value = "reqslist"
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Columns("A:A").Select
Range("A1:A" & lastr_sh3).AdvancedFilter Action:=xlFilterInPlace,
Unique:=True
Selection.CurrentRegion.Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveSheet.ShowAllData
Columns("A").Delete
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Range("B2").Formula = "=SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)"
Range("C2").Formula = "=SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)"
Range("B2:C2").AutoFill Destination:=Range("B2:C" & lastr_sh3),
Type:=xlFillDefault
End Sub

Regards,
Stefi


€žSR€ ezt Ã*rta:

Hi,

I need a macro to relect the values in column B of sheet 1 and sheet 2 to be
incorporated without duplicates in column A of sheet3.This needs to be done
along with the summation of values from column L of sheet1 and sheet2 in to
sheet3(column B and column C).

Pls help!!


"Stefi" wrote:

List all instances of Reqn in Sheet3 column A:

Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 formula1 formula2
Req2

Drag down formulae as required!
formula1: =SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)
formula2: =SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)


Regards,
Stefi

€žSR€ ezt Ã*rta:

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Excel-Macro Problem

Tomorrow or next week!
Stefi


€žSR€ ezt Ã*rta:

Thanks Stefi,

But could u give me a genaralized (which can have any value for data)
function which meets the following requirements:

Sheet1 --values start from B6, L6
Sheet2---values start from B24, L24

Output Sheet
Sheet3--values start from A2, B2,C2






"Stefi" wrote:

Here you a

Sub test()
Worksheets("Sheet1").Range("A1").Value = "reqslist"
Worksheets("Sheet2").Range("A1").Value = "reqslist"
lastr_sh1 = Worksheets("Sheet1").Columns("A:A").End(xlDown).Ro w
lastr_sh2 = Worksheets("Sheet2").Columns("A:A").End(xlDown).Ro w
Worksheets("Sheet1").Range("A2:A" & lastr_sh1).Copy
Destination:=Worksheets("Sheet3").Range("A2")
Worksheets("Sheet2").Range("A2:A" & lastr_sh2).Copy
Destination:=Worksheets("Sheet3").Range("A" & lastr_sh1 + 1)
Worksheets("Sheet3").Select
Range("A1").Value = "reqslist"
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Columns("A:A").Select
Range("A1:A" & lastr_sh3).AdvancedFilter Action:=xlFilterInPlace,
Unique:=True
Selection.CurrentRegion.Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveSheet.ShowAllData
Columns("A").Delete
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Range("B2").Formula = "=SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)"
Range("C2").Formula = "=SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)"
Range("B2:C2").AutoFill Destination:=Range("B2:C" & lastr_sh3),
Type:=xlFillDefault
End Sub

Regards,
Stefi


€žSR€ ezt Ã*rta:

Hi,

I need a macro to relect the values in column B of sheet 1 and sheet 2 to be
incorporated without duplicates in column A of sheet3.This needs to be done
along with the summation of values from column L of sheet1 and sheet2 in to
sheet3(column B and column C).

Pls help!!


"Stefi" wrote:

List all instances of Reqn in Sheet3 column A:

Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 formula1 formula2
Req2

Drag down formulae as required!
formula1: =SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)
formula2: =SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)


Regards,
Stefi

€žSR€ ezt Ã*rta:

Sorry Stefi, u r right!.it is 16.6 and 8.3


"Stefi" wrote:

Rule of generating Sheet3 is not clear! If you want to sum up values in rows
with Req1, Req2 in column A (like 10.3, 8.5 in column C show), then Sheet3
column B should contain 16.6, 8.3 (and not 8.6, 8.3)! Is it true?

Regards,
Stefi


€žSR€ ezt Ã*rta:

Pls help me find soln to the below problem:

Requirement:

Sheet1

Colm B Colm L

Req1 8.2
Req2 8.3
Req1 8.4


Sheet2
Colm B Colm L
Req1 5.1
Req2 8.5
Req1 5.2


Upon Button click of Sheet2, Sheet3 values should be as shown below:


Sheet3
Colm A Colm B (as per sheet1) Colm C (as per sheet2)

Req1 8.6 10.3
Req2 8.3 8.5

Pls guide..

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Excel-Macro Problem

Sub test_caller()
Call Par_test(2, 24)
End Sub

Sub Par_test(startr_sh1, startr_sh2)
Worksheets("Sheet1").Range("B1").Value = "reqslist"
Worksheets("Sheet2").Range("B1").Value = "reqslist"
lastr_sh1 = Worksheets("Sheet1").Range("B" & startr_sh1 & ":B" &
Rows.Count).End(xlDown).Row
lastr_sh2 = Worksheets("Sheet2").Range("B" & startr_sh2 & ":B" &
Rows.Count).End(xlDown).Row
Worksheets("Sheet1").Range("B" & startr_sh1 & ":B" & lastr_sh1).Copy _
Destination:=Worksheets("Sheet3").Range("A2")
Worksheets("Sheet2").Range("B" & startr_sh2 & ":B" & lastr_sh2).Copy _
Destination:=Worksheets("Sheet3").Range("A" & lastr_sh1 + 1)
Worksheets("Sheet3").Select
Range("A1").Value = "reqslist" 'column A must have a header to make
"AdvancedFilter Action:=xlFilterInPlace, Unique:=True" work well!
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Columns("A:A").Select
Range("A1:A" & lastr_sh3).AdvancedFilter Action:=xlFilterInPlace,
Unique:=True
Selection.CurrentRegion.Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
ActiveSheet.ShowAllData
Columns("A").Delete
lastr_sh3 = Worksheets("Sheet3").Columns("A:A").End(xlDown).Ro w
Range("B2").Formula = "=SUMIF(Sheet1!$B:$B,$A2,Sheet1!$L:$L)"
Range("C2").Formula = "=SUMIF(Sheet2!$B:$B,$A2,Sheet2!$L:$L)"
Range("B2:C2").AutoFill Destination:=Range("B2:C" & lastr_sh3),
Type:=xlFillDefault
End Sub

Regards,
Stefi


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
Printing Problem In Excel Due to Macro? [email protected] Excel Discussion (Misc queries) 4 March 20th 07 04:05 PM
Macro problem in Excel pd Excel Discussion (Misc queries) 2 March 14th 06 05:49 AM
problem with macro on Excel Captain Picard Excel Worksheet Functions 0 February 1st 06 09:20 PM
problem with import files by excel macro Raven Excel Discussion (Misc queries) 0 January 20th 06 08:23 AM
Urgent Help Required on Excel Macro Problem Sachin Shah Excel Discussion (Misc queries) 1 August 17th 05 06:26 AM


All times are GMT +1. The time now is 01:42 PM.

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"