Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
not tested but this should do it, Sub LookupUpdateExisting() Dim Cel As Range, c As Range For x = 1 To 5 With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, x) = c.Offset(, x) End If Next End With Next End Sub Mike "DavidH56" wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You forget a dot in front of the Range function on the For Each line.
Also untested... I think this slight simplification will do the same as your code (it eliminates a loop)... Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then c.Offset(, 1).Resize(1, 5).Copy Cel.Offset(, X) End If Next End With End Sub -- Rick (MVP - Excel) "Mike H" wrote in message ... Hi, not tested but this should do it, Sub LookupUpdateExisting() Dim Cel As Range, c As Range For x = 1 To 5 With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, x) = c.Offset(, x) End If Next End With Next End Sub Mike "DavidH56" wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is air code so test first.
Sub LookupUpdateExisting() Dim Cel As Range, c As Range Dim i As Long Do Until i = 5 With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, i) = c.Offset(, i) End If i = i + 1 Next End With Loop End Sub --JP On Sep 22, 2:16*pm, DavidH56 wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() * * Dim Cel As Range, c As Range * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 1) = c.Offset(, 1) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 2) = c.Offset(, 2) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 3) = c.Offset(, 3) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 4) = c.Offset(, 4) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 5) = c.Offset(, 5) * * * * * * End If * * * * Next * * End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi,
You would need to initialise i (i=1) so it isn't zero on the first pass and increment i outside the with - end with statement Mike "JP" wrote: This is air code so test first. Sub LookupUpdateExisting() Dim Cel As Range, c As Range Dim i As Long Do Until i = 5 With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, i) = c.Offset(, i) End If i = i + 1 Next End With Loop End Sub --JP On Sep 22, 2:16 pm, DavidH56 wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, knew I'd forgotten something.
--JP On Sep 22, 2:52*pm, Mike H wrote: hi, You would need to initialise i (i=1) so it isn't zero on the first pass and increment i outside the with - end with statement Mike "JP" wrote: This is air code so test first. Sub LookupUpdateExisting() * * Dim Cel As Range, c As Range * * Dim i As Long * * Do Until i = 5 * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, i) = c.Offset(, i) * * * * * * End If * * * * * * i = i + 1 * * * * Next * * End With * * Loop End Sub --JP On Sep 22, 2:16 pm, DavidH56 wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() * * Dim Cel As Range, c As Range * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 1) = c.Offset(, 1) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 2) = c.Offset(, 2) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 3) = c.Offset(, 3) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 4) = c.Offset(, 4) * * * * * * End If * * * * Next * * End With * * With Sheets("Master") * * * * For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) * * * * * * Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) * * * * * * If Not c Is Nothing Then * * * * * * * * Cel.Offset(, 5) = c.Offset(, 5) * * * * * * End If * * * * Next * * End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great.- Hide quoted text - - Show quoted text - |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub LookupUpdateExisting()
Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(0, 1).resize(1,4).value = c.Offset(0, 1).resize(1,4).value End If Next End With end sub -- HTH... Jim Thomlinson "DavidH56" wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ooops... In the resize of the range change the 4 to a 5...
-- HTH... Jim Thomlinson "Jim Thomlinson" wrote: Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(0, 1).resize(1,4).value = c.Offset(0, 1).resize(1,4).value End If Next End With end sub -- HTH... Jim Thomlinson "DavidH56" wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your quick response Jim. Thanks Rick and Mike and JP for your
input. This works perfectly and so fast. I'm always amazed at the vast knowledge that I glean from you experts. This is exactly what I was looking for. One last question. How would I copy over formats as well? (ie bold font..) Thanks again. -- By persisting in your path, though you forfeit the little, you gain the great. "Jim Thomlinson" wrote: Ooops... In the resize of the range change the 4 to a 5... -- HTH... Jim Thomlinson "Jim Thomlinson" wrote: Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(0, 1).resize(1,4).value = c.Offset(0, 1).resize(1,4).value End If Next End With end sub -- HTH... Jim Thomlinson "DavidH56" wrote: Hi, Is there a way to simplyfy this code? I'm basically updating the Master sheet in 5 adjacent columns. Sub LookupUpdateExisting() Dim Cel As Range, c As Range With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 1) = c.Offset(, 1) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 2) = c.Offset(, 2) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 3) = c.Offset(, 3) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 4) = c.Offset(, 4) End If Next End With With Sheets("Master") For Each Cel In Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(xlUp)) Set c = Sheets("Update").Columns(1).Find(Cel, lookat:=xlWhole) If Not c Is Nothing Then Cel.Offset(, 5) = c.Offset(, 5) End If Next End With End Sub Thanks in advance. -- By persisting in your path, though you forfeit the little, you gain the great. |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your quick response Jim. Thanks Rick and Mike and JP for your
input. This works perfectly and so fast. I'm always amazed at the vast knowledge that I glean from you experts. This is exactly what I was looking for. One last question. How would I copy over formats as well? (ie bold font..) I guess you didn't actually try my code out then, did you?<g The code I posted preserve the formatting of the cell. -- Rick (MVP - Excel) |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes I did try your code at home. Not at work. The code worked but for some
reason format was not maintained. I'll try at work tomorrow. Thanks.. -- By persisting in your path, though you forfeit the little, you gain the great. "Rick Rothstein" wrote: Thanks for your quick response Jim. Thanks Rick and Mike and JP for your input. This works perfectly and so fast. I'm always amazed at the vast knowledge that I glean from you experts. This is exactly what I was looking for. One last question. How would I copy over formats as well? (ie bold font..) I guess you didn't actually try my code out then, did you?<g The code I posted preserve the formatting of the cell. -- Rick (MVP - Excel) |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My mistake Rick, I tried Jim's code. I hadn't realized they're different.
-- By persisting in your path, though you forfeit the little, you gain the great. "Rick Rothstein" wrote: Thanks for your quick response Jim. Thanks Rick and Mike and JP for your input. This works perfectly and so fast. I'm always amazed at the vast knowledge that I glean from you experts. This is exactly what I was looking for. One last question. How would I copy over formats as well? (ie bold font..) I guess you didn't actually try my code out then, did you?<g The code I posted preserve the formatting of the cell. -- Rick (MVP - Excel) |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rick, I just tried you code. Font formatting was maintained bur I lost column
and row formatting on the master sheet. Thanks. -- By persisting in your path, though you forfeit the little, you gain the great. "Rick Rothstein" wrote: Thanks for your quick response Jim. Thanks Rick and Mike and JP for your input. This works perfectly and so fast. I'm always amazed at the vast knowledge that I glean from you experts. This is exactly what I was looking for. One last question. How would I copy over formats as well? (ie bold font..) I guess you didn't actually try my code out then, did you?<g The code I posted preserve the formatting of the cell. -- Rick (MVP - Excel) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simplify code | Excel Worksheet Functions | |||
Please help me simplify the given code | Excel Programming | |||
Need to simplify code | Excel Discussion (Misc queries) | |||
Simplify Code | Excel Programming | |||
Help to simplify code. | Excel Programming |