$$Excel-Macros$$ conditional formatting

2012-07-26 Thread Smitha S R
Hi,

Please help in conditional formatting or use of if formula in the following
case. Excel attached.

  Closing Stock Verification stock required  1 1 if closing
Stock=Verification Stock blue colour should be filled in cell B3  5 4 if
closing StockVerification Stock  green colour should be filled in cell B4
3 5 if closing StockVerification Stock yellow  colour should be filled in
cell B5

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




fill colour.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


Re: $$Excel-Macros$$ conditional formatting

2012-07-26 Thread Manoj Kumar
Dear Smitha,

Please find the attachment..

it will help you...

Regard
Manoj

On Thu, Jul 26, 2012 at 11:44 AM, Smitha S R sperdwo...@gmail.com wrote:

 Hi,

 Please help in conditional formatting or use of if formula in the
 following case. Excel attached.

   Closing Stock Verification stock required  1 1 if closing
 Stock=Verification Stock blue colour should be filled in cell B3  5 4 if
 closing StockVerification Stock  green colour should be filled in cell B4
 3 5 if closing StockVerification Stock yellow  colour should be filled
 in cell B5

 --
 --
 FORUM RULES (986+ members already BANNED for violation)

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.

 2) Don't post a question in the thread of another member.

 3) Don't post questions regarding breaking or bypassing any security
 measure.

 4) Acknowledge the responses you receive, good or bad.

 5) Cross-promotion of, or links to, forums competitive to this forum in
 signatures are prohibited.

 NOTE : Don't ever post personal or confidential data in a workbook. Forum
 owners and members are not responsible for any loss.


 --
 To post to this group, send email to excel-macros@googlegroups.com

 To unsubscribe, send a blank email to
 excel-macros+unsubscr...@googlegroups.com




-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




fill colour.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


Re: $$Excel-Macros$$ Re: Summary Sheet for all Employees

2012-07-26 Thread prkhan56
Hello Pascal,
Your code does not pick up the General Category Activity from Row 911 in 
Original Sheet.
Please look into this.
Thanks for your effort

On Wednesday, July 25, 2012 11:42:41 PM UTC+4, bpascal123 wrote:

 Hi Anil,

 I have started looking at your query. I'm getting somewhere with the code 
 below but if someone in this forum can me figure out why these lines are 
 not getting all values:

 'This loop stores the number of times an activity occurs between 2 merged 
 cells -- need assistance,,, not accurate
 ReDim actNb(0)
 i = 0: j = 0
 For Each c In r
 If Not c.MergeCells Then
 j = j + 1
 Else
 actNb(i) = j
 i = i + 1
 ReDim Preserve actNb(i)
 j = 0
 End If
 Next
 The code I have worked out is below. If someone can help, it would speed 
 things up otherwise I'll take another look this week-end if I can.

 Sub ModuleA()

 'wor is original data wou is output sheet
 Dim wor As Worksheet, wou As Worksheet
 Set wor = ThisWorkbook.Worksheets(Original)
 Set wou = ThisWorkbook.Worksheets(Output)

 With Application
 .Calculation = xlCalculationManual
 .ScreenUpdating = False
 .DisplayAlerts = False
 End With

 Dim r As Range
 Dim c As Range
 'hdr is an array to copy the first header
 'emp is an array to store employee names
 'act is an array to store the data related to the merged cells you label 
 as activity
 'actNb is an array that should store the number of times of an activity 
 for each firm
 Dim hdr(), emp(), firm(), act(), actNb()
 Dim lastr As Long, lastc As Long
 Dim empNb As Long
 Dim i As Long, j As Long, k As Long

 'formatting stuff...
 wou.Cells.Delete
 hdr = Array(Firm, Activity, Subtask, No, Capacity, Modified 
 Risk Rating, Name, Hours, EOM)
 wou.Range(A1:i1) = hdr
 wou.Range(A1:i1).Font.Bold = True
 wou.Range(A1:I1).Interior.Color = 65535
 lastc = wor.Cells(4, Columns.Count).End(xlToLeft).Column
 emp = wor.Range(wor.Cells(4, 6), wor.Cells(4, lastc))
 empNb = UBound(emp, 2)

 ReDim act(0)
 ReDim firm(0)
 lastr = wor.Cells(Rows.Count, 1).End(xlUp).Row
 'r stores the first column
 Set r = wor.Range(wor.Cells(10, 1), wor.Cells(lastr, 1))

 'this loop stores data in 2 arrays: act for merged cells values and firm 
 for Firm cell values
 i = 0: j = 0
 For Each c In r
 If c.MergeCells Then
 act(i) = c.Value
 i = i + 1
 ReDim Preserve act(i)
 Else
 firm(j) = c.Value
 j = j + 1
 ReDim Preserve firm(j)
 End If
 Next

 i = i - 1
 ReDim Preserve act(i)
 j = j - 1
 ReDim Preserve firm(j)

 'This loop stores the number of times an activity occurs between 2 merged 
 cells -- need assistance,,, not accurate
 ReDim actNb(0)
 i = 0: j = 0
 For Each c In r
 If Not c.MergeCells Then
 j = j + 1
 Else
 actNb(i) = j
 i = i + 1
 ReDim Preserve actNb(i)
 j = 0
 End If
 Next

 'This copies the data from the firm x the number of employees
 j = 2
 For i = 0 To UBound(emp, 2)
 wou.Range(wou.Cells(j, 1), wou.Cells(j + UBound(firm, 1), 1)).Value = _
 WorksheetFunction.Transpose(firm)
 j = j + UBound(firm, 1)
 Next i

 'This copies the data from the activity labelled in the merged cells, it 
 should work if actNb was ok
 k = 0
 For i = 0 To UBound(emp, 2)
 For j = 0 To UBound(act, 1)
 wou.Range(wou.Cells(k + 2, 2), wou.Cells(actNb(j + 1) + 2 + k, 
 2)).Value = act(j)
 k = k + actNb(j + 1)
 Next j
 Next i

 With Application
 .Calculation = xlCalculationAutomatic
 .ScreenUpdating = True
 .DisplayAlerts = True
 End With

 End Sub


 So should someone help me fix the wrongdoing loop, this code will first 
 work with the first 2 columns.

 As I said earlier, if you could manage to have your data re-arranged and 
 sorted in another way, because I really see this as the job of a pivot 
 table. More, at my vba level coding this with this code will require a few 
 more consistent loops. If your original data ever changes, a lot will have 
 to changed as well.

 I'll be happy if I can get you with a final result but it will take some 
 more times unless someone comes with a fix or an easier solution.

 Pascal Baro


-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to 

Re: $$Excel-Macros$$ conditional formatting

2012-07-26 Thread Kuldeep Singh
Dear Smitha,

Please try this. (Sheet - 1  Sheet - 2)

Regards,
Kuldeep Singh
Phone.: +91-120-4763789, Extn.: 789
naukrikuld...@gmail.com || www.naukri.com
*Please* *Consider the environment. Please don't print this e-mail unless
you really need to.*

On Thu, Jul 26, 2012 at 11:44 AM, Smitha S R sperdwo...@gmail.com wrote:

 Hi,

 Please help in conditional formatting or use of if formula in the
 following case. Excel attached.

   Closing Stock Verification stock required  1 1 if closing
 Stock=Verification Stock blue colour should be filled in cell B3  5 4 if
 closing StockVerification Stock  green colour should be filled in cell B4
 3 5 if closing StockVerification Stock yellow  colour should be filled
 in cell B5

 --
 --
 FORUM RULES (986+ members already BANNED for violation)

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.

 2) Don't post a question in the thread of another member.

 3) Don't post questions regarding breaking or bypassing any security
 measure.

 4) Acknowledge the responses you receive, good or bad.

 5) Cross-promotion of, or links to, forums competitive to this forum in
 signatures are prohibited.

 NOTE : Don't ever post personal or confidential data in a workbook. Forum
 owners and members are not responsible for any loss.


 --
 To post to this group, send email to excel-macros@googlegroups.com

 To unsubscribe, send a blank email to
 excel-macros+unsubscr...@googlegroups.com


-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




Conditional Formatting Queryxlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


Re: $$Excel-Macros$$ Re: Summary Sheet for all Employees

2012-07-26 Thread bpascal123
Hi,
I could see that. David is helping on this. I can't look at it now. I see 
this code or this task to be split into different modules. Each module 
should take one or two loops. It'll be easier to work from that then.I'll 
start again from this.The main loop for each column loops as many time as 
there are employees. The sub loop is then easy to paste data. The thing 
you've spot is because you have merged cells you want to parse as range 
data, this is some techniques I don't feel comfortable with in Vba. If you 
don't have merged cells that way, this task could be completed already
Regards,
Pascal

On Thursday, July 26, 2012 7:51:33 AM UTC+1, prkhan56 wrote:

 Hello Pascal,
 Your code does not pick up the General Category Activity from Row 911 in 
 Original Sheet.
 Please look into this.
 Thanks for your effort


-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




$$Excel-Macros$$ Value paste the real time data

2012-07-26 Thread Kal xcel
Dear Experts,

I need your help to storing data which generating from web. Details is in
attached file.

Please help

Thanks in advance.
-- 
*Kalyan Chattopadhyay*

*Executive Sales Coordinator*
*R. S. H. Pvt. Ltd.*

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




v_paste.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


Re: $$Excel-Macros$$ Value paste the real time data

2012-07-26 Thread anil kumar
Hello friend,

you have a circular Reference in D6 check it. than try.


anil

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




Re: $$Excel-Macros$$ Value paste the real time data

2012-07-26 Thread Kal xcel
Dear Experts,

Sorry I send a wrong filesending the right one.

I need your help to storing data which generating from web. Details is in
attached file.

Please help

Thanks in advance.
-- 

Kalyan Chattopadhyay

Executive Sales Coordinator
R. S. H. Pvt. Ltd.

On Thu, Jul 26, 2012 at 5:19 PM, anil kumar kmr7a...@gmail.com wrote:

 Hello friend,

 you have a circular Reference in D6 check it. than try.


 anil

 --
 --
 FORUM RULES (986+ members already BANNED for violation)

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.

 2) Don't post a question in the thread of another member.

 3) Don't post questions regarding breaking or bypassing any security
 measure.

 4) Acknowledge the responses you receive, good or bad.

 5) Cross-promotion of, or links to, forums competitive to this forum in
 signatures are prohibited.

 NOTE : Don't ever post personal or confidential data in a workbook. Forum
 owners and members are not responsible for any loss.


 --
 To post to this group, send email to excel-macros@googlegroups.com

 To unsubscribe, send a blank email to
 excel-macros+unsubscr...@googlegroups.com






-- 
*Kalyan Chattopadhyay*

*Executive Sales Coordinator*
*R. S. H. Pvt. Ltd.*

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




v_paste.xlsx
Description: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


$$Excel-Macros$$ Re: need formulae to pick next highest value by checking two values - 1) text and 2) number

2012-07-26 Thread vijay yadav
SOLVED!!!
 
wasted some 5 hours to get the answers in right cells,
 
used the following formulaes
 
=INDEX(OFFSET($A$2:$A$22,0,(MATCH(A53,$B$1:$V$1,0)+1)),MATCH(A54,OFFSET($A$2:$A$22,0,MATCH(A53,$B$1:$V$1,0)),1)+1)
=INDEX(OFFSET($A$2:$A$22,0,0),MATCH(A54,OFFSET($A$2:$A$22,0,MATCH(A53,$B$1:$V$1,0)),1)+1)
=INDEX(OFFSET($A$2:$A$22,0,9),MATCH(A54,OFFSET($A$2:$A$22,0,MATCH(A53,$B$1:$V$1,0)),1)+1)
 
*Thanks to Sam Mathai Chacko for initial help which helped me save alot of 
hours*

** 
*Regards*
*Vijay Yadav

* 

On Wednesday, 25 July 2012 19:31:37 UTC+5:30, vijay yadav wrote:

 Dear Experts
  
 In the attached sheet I have the formuale in A55which gives a output by 
 checking the A53 and A54 cells.Also I need outputs in cells A56,A57,A58 and 
 A59.
  
 Please help me to get these values.
  
 The Answers are in same row ,as the row from where the output in A55 had 
 come under the headers-HEADER,RPM,GD sq and of the adjacent row
  
 Please see the attached file
  Please help
  
 Regards
 Vijay



-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com




Re: $$Excel-Macros$$ Re: Summary Sheet for all Employees

2012-07-26 Thread bpascal123
Hi Rashid,

I worked from the first workbook of your query and made the code easier to 
change to whatever you need. There is a main sub and a function. Actually 
the function does most of the copy paste but I use it to return the row 
number of merged cells. As for now, the code works fine with these 
columns Firm Activity No Capacity Rating

Column category requires data from merged cell to be rearranged. The 
function returns the row position of merged cells so anyone here can work 
it out. It's even possible to change this line MCellA(i) = c.Row - 9 to 
something c.Address or c.row Address... these are methods/properties some 
people might feel more comfortable with. Without any changes  MCell() holds 
row numbers and can be used to help copy paste merged cells and I think 
employee names as well. I don't see clear enough at this time...

I also think I understand the discrepancy from the first code I provided, I 
didn't think about the 9 rows over the main data source from your original 
sheet. That might explain why it wouldn't match the first column.

So the code below almost does it all. Now that I understand, I make your 
query complete tomorrow. In between if someone can do it in his own way, I 
would interested to see how else can this be done.

---
Public wOriginal As Worksheet
Public wOrig2 As Worksheet
Public wOut As Worksheet

Sub Layout()

Dim hdr() 'Header for output2 sheet
Dim Emp() 'stores employee name from Original_tmp Sheet
Dim MCell() 'stores merged cells address

Dim r As Range

Dim lastc As Long 'Last column in the employee range
Dim NBEMP As Long 'Number of employee (iteration limit for the main loop)
Dim lastr As Long 'Number of row

Set wOriginal = ThisWorkbook.Worksheets(Original)
ThisWorkbook.Worksheets.Add(After:=wOriginal).Name = Original_tmp 
'comment this line out if the sheet already exists
Set wOrig2 = ThisWorkbook.Worksheets(Original_tmp)
ThisWorkbook.Worksheets.Add(After:=wOrig).Name = OutPut2 '  'comment this 
line out if the sheet already exists
Set wOut = ThisWorkbook.Worksheets(Output2)

'Last row
lastr = wOrig2.Cells(Rows.Count, 1).End(xlUp).Row
Set r = wOrig2.Range(wOrig2.Cells(10, 1), wOrig2.Cells(lastr, 1))

wOriginal.Cells.Copy wOrig2.Cells
hdr = Array(Firm, Category, Activity, No, Capacity, Rating, 
Name, Hours, EOM)
wOut.Range(A1:I1) = hdr
wOut.Range(A1:I1).Font.Bold = True
wOut.Range(A1:I1).Interior.Color = 65535
 
'Last column in the employee range in the original data header row
lastc = wOrig2.Cells(4, Columns.Count).End(xlToLeft).Column
NBEMP = lastc - 5

'COPY PASTE THE FIRST COLUMN FIRM AND RETURNS MERGED CELLS ROW NUMBERS
MCell() = CopyFirstCol(r, wOut, NBEMP)

End Sub


Function CopyFirstCol(rg As Range, wsB As Worksheet, NEMP As Long)
'
'This function both copies pastes columns 1 and return an array with merged 
cells row numbers
'
Dim c As Range
Dim MCellV() 'Array to store merged cells values
Dim MCellA() 'Array to store merged cells addresses or row numbers
Dim Firm() 'Array to store col 1
Dim Activity() 'Array to store col 2
Dim No() 'Array to store col 4
Dim Capacity() 'Array to store col 5
Dim Rating() 'Array to store col 6
Dim i As Long, j As Long
Dim N As Long

i = 0
ReDim MCellV(i)
ReDim MCellA(i)
j = 0
ReDim Firm(j)
ReDim Activity(j)
ReDim No(j)
ReDim Capacity(j)
ReDim Rating(j)
For Each c In rg
If c.MergeCells Then
MCellV(i) = c.Value
MCellA(i) = c.Row - 9
i = i + 1
ReDim Preserve MCellV(i)
ReDim Preserve MCellA(i)
Else
Firm(j) = c.Value
Activity(j) = c.Offset(, 1).Value
No(j) = c.Offset(, 2).Value
If c.Offset(, 2).Value = vbNullString Then No(j) = NA
Capacity(j) = c.Offset(, 3).Value
If c.Offset(, 3).Value = vbNullString Then Capacity(j) = NA
Rating(j) = c.Offset(, 4).Value
If c.Offset(, 4).Value = vbNullString Then Rating(j) = NA
j = j + 1
ReDim Preserve Firm(j)
ReDim Preserve Activity(j)
ReDim Preserve No(j)
ReDim Preserve Capacity(j)
ReDim Preserve Rating(j)
End If
Next c

N = j

'This copies the data from the firm x the number of employees
j = 2
For i = 0 To NEMP
wsB.Range(wsB.Cells(j, 1), wsB.Cells(j + N, 1)).Value = _
WorksheetFunction.Transpose(Firm)

wsB.Range(wsB.Cells(j, 3), wsB.Cells(j + N, 3)).Value = _
WorksheetFunction.Transpose(Activity)

wsB.Range(wsB.Cells(j, 4), wsB.Cells(j + N, 4)).Value = _
WorksheetFunction.Transpose(No)

wsB.Range(wsB.Cells(j, 5), wsB.Cells(j + N, 5)).Value = _
WorksheetFunction.Transpose(Capacity)

wsB.Range(wsB.Cells(j, 6), wsB.Cells(j + N, 6)).Value = _
WorksheetFunction.Transpose(Rating)

j = j + N
Next i

CopyFirstCol = MCellA

End Function

---

Pascal Baro




-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will 

Re: $$Excel-Macros$$ Amend code to copy worksheets to new Worksheets upon selection via drop down lists.

2012-07-26 Thread David Grugeon
Hi Kevin

Add a hidden blank sheet called Link to your WB (or it may need to be
called Linknothing depending on what is actually in col J

Change the line
Sheets.Add After:=Sheets(Sheets.Count) '

to

sheets(Link  MyCell.offset(0,7).value).copy After:=Sheets(Sheets.Count)

Regards
David Grugeon


On 27 July 2012 03:57, skyping1 kevinrobertg...@hotmail.com wrote:

 Need your help once again!!!

 A previous project needs to be updated and I simply cannot my head around
 it.

 I have a workbook that currently comprises of 5 worksheets, 3 of which are
 relating to my problem and are hidden. These are called Link1, Link2, and
 Link3.

 The initial concept of the project was to generate new worksheets labelled
 from the contents of c12:c31 on the Intro worksheet. This works fineā€¦. see
 macro below:

 Private Sub GENERATE_Click()
 On Error Resume Next
 Call DeleteSheets
 Dim MyCell As Range, MyRange As Range
 Set MyRange = Sheets(Intro).Range(c12)
 Set MyRange = Range(MyRange, MyRange.End(xlDown))
 For Each MyCell In MyRange
 Sheets.Add After:=Sheets(Sheets.Count) 'creates a new worksheet
 Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet
 Next MyCell
 End Sub

 However, I have added another variable which is displayed in a drop down
 list in j12:j31, which relates to the content of these 3 new hidden sheets.

 What I need to do is when generating the new sheets via the Generate
 macro, the corresponding selection in column J, will copy the relevant
 sheet (Link1, Link2, Link3 or nothing) to the new sheet with the
 corresponding name from column C.

 I really hope this is coherent (!!) and welcome any advice on this problem.

 Many thanks for looking.

  --
 --
 FORUM RULES (986+ members already BANNED for violation)

 1) Use concise, accurate thread titles. Poor thread titles, like Please
 Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
 will not get quick attention or may not be answered.

 2) Don't post a question in the thread of another member.

 3) Don't post questions regarding breaking or bypassing any security
 measure.

 4) Acknowledge the responses you receive, good or bad.

 5) Cross-promotion of, or links to, forums competitive to this forum in
 signatures are prohibited.

 NOTE : Don't ever post personal or confidential data in a workbook. Forum
 owners and members are not responsible for any loss.


 --
 To post to this group, send email to excel-macros@googlegroups.com

 To unsubscribe, send a blank email to
 excel-macros+unsubscr...@googlegroups.com

 --
 David Grugeon

  excel-macros%2bunsubscr...@googlegroups.com

-- 
-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

--
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com