Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm having trouble copying values from multiple worksheets into my summary sheet. What I need to do is, look at the value in column C, go to the worksheet with that name, find the bold cell, copy that value and paste it back in column L of the first sheet. I can do this for one cell, but how do I repeat it for each row in my summary table? Below is my attempt at code. Any thoughts? Sub FindBold() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim Rng As Range Dim jRow As Long For jRow = 14 To Cells(Rows.Count, "A").End(xlUp).Row Worksheets(Range(Cells(jRow, 3)).Text).Activate Cells.Find(What:="", After:=Range("C14"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate Selection.Copy Sheets("BRIDGE").Select Range(Cells(jRow, 12)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Next jRow Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range(Cells(jRow, 12)).Select
should be Cells(jRow, 12).Select -- Regards, Tom Ogilvy "Melinda" wrote: Hello, I'm having trouble copying values from multiple worksheets into my summary sheet. What I need to do is, look at the value in column C, go to the worksheet with that name, find the bold cell, copy that value and paste it back in column L of the first sheet. I can do this for one cell, but how do I repeat it for each row in my summary table? Below is my attempt at code. Any thoughts? Sub FindBold() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim Rng As Range Dim jRow As Long For jRow = 14 To Cells(Rows.Count, "A").End(xlUp).Row Worksheets(Range(Cells(jRow, 3)).Text).Activate Cells.Find(What:="", After:=Range("C14"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate Selection.Copy Sheets("BRIDGE").Select Range(Cells(jRow, 12)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Next jRow Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
I changed the cell reference, and now the macro runs, but it pastes no values. I'm sure I'm missing something easy. If I step into the macro and hover my cursor over Cells(jRow,12).Select, it shows jRow=0, instead of a value in my range. Any more ideas? Thanks a lot! Melinda "Tom Ogilvy" wrote: Range(Cells(jRow, 12)).Select should be Cells(jRow, 12).Select -- Regards, Tom Ogilvy "Melinda" wrote: Hello, I'm having trouble copying values from multiple worksheets into my summary sheet. What I need to do is, look at the value in column C, go to the worksheet with that name, find the bold cell, copy that value and paste it back in column L of the first sheet. I can do this for one cell, but how do I repeat it for each row in my summary table? Below is my attempt at code. Any thoughts? Sub FindBold() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim Rng As Range Dim jRow As Long For jRow = 14 To Cells(Rows.Count, "A").End(xlUp).Row Worksheets(Range(Cells(jRow, 3)).Text).Activate Cells.Find(What:="", After:=Range("C14"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate Selection.Copy Sheets("BRIDGE").Select Range(Cells(jRow, 12)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Next jRow Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
you have
for jrow = 14 to Cells(Rows.Count, "A").End(xlUp).Row if the activesheet has values in row 14 and below (14), I don't see how jrow could have a value of zero. Your code looks OK to me unless you have blank cells that are formatted as bold. Why not leave screenupdating turned on and see what your macro is doing. -- Regards, Tom Ogilvy "Melinda" wrote in message ... Hi Tom, I changed the cell reference, and now the macro runs, but it pastes no values. I'm sure I'm missing something easy. If I step into the macro and hover my cursor over Cells(jRow,12).Select, it shows jRow=0, instead of a value in my range. Any more ideas? Thanks a lot! Melinda "Tom Ogilvy" wrote: Range(Cells(jRow, 12)).Select should be Cells(jRow, 12).Select -- Regards, Tom Ogilvy "Melinda" wrote: Hello, I'm having trouble copying values from multiple worksheets into my summary sheet. What I need to do is, look at the value in column C, go to the worksheet with that name, find the bold cell, copy that value and paste it back in column L of the first sheet. I can do this for one cell, but how do I repeat it for each row in my summary table? Below is my attempt at code. Any thoughts? Sub FindBold() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim Rng As Range Dim jRow As Long For jRow = 14 To Cells(Rows.Count, "A").End(xlUp).Row Worksheets(Range(Cells(jRow, 3)).Text).Activate Cells.Find(What:="", After:=Range("C14"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate Selection.Copy Sheets("BRIDGE").Select Range(Cells(jRow, 12)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Next jRow Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I turned on screenupdating and it's not doing anything. It's just
sitting there. I don't know why it insists that jrow is equal to 0, but that would explain why it doesn't do anything. It's all very odd. I checked the sheets that the macro should be going to to copy, and there are no blank cells formatted as bold. Any more ideas? Thank you so much for your time! Melinda Tom Ogilvy wrote: you have for jrow = 14 to Cells(Rows.Count, "A").End(xlUp).Row if the activesheet has values in row 14 and below (14), I don't see how jrow could have a value of zero. Your code looks OK to me unless you have blank cells that are formatted as bold. Why not leave screenupdating turned on and see what your macro is doing. -- Regards, Tom Ogilvy "Melinda" wrote in message ... Hi Tom, I changed the cell reference, and now the macro runs, but it pastes no values. I'm sure I'm missing something easy. If I step into the macro and hover my cursor over Cells(jRow,12).Select, it shows jRow=0, instead of a value in my range. Any more ideas? Thanks a lot! Melinda "Tom Ogilvy" wrote: Range(Cells(jRow, 12)).Select should be Cells(jRow, 12).Select -- Regards, Tom Ogilvy "Melinda" wrote: Hello, I'm having trouble copying values from multiple worksheets into my summary sheet. What I need to do is, look at the value in column C, go to the worksheet with that name, find the bold cell, copy that value and paste it back in column L of the first sheet. I can do this for one cell, but how do I repeat it for each row in my summary table? Below is my attempt at code. Any thoughts? Sub FindBold() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim Rng As Range Dim jRow As Long For jRow = 14 To Cells(Rows.Count, "A").End(xlUp).Row Worksheets(Range(Cells(jRow, 3)).Text).Activate Cells.Find(What:="", After:=Range("C14"), LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=True).Activate Selection.Copy Sheets("BRIDGE").Select Range(Cells(jRow, 12)).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Next jRow Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SUM VALUES on MULTIPLE SHEETS | Excel Worksheet Functions | |||
copy all and paste values for all sheets in a workbook | Excel Worksheet Functions | |||
copy sheets with values only and NO link to old workbook | Excel Programming | |||
Lookup multiple values on multiple sheets | Excel Programming | |||
How to get a sum of values from multiple sheets | Excel Programming |