Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found the problem. RowCount was being increnmented. sorry. I also change
the first row processed from 1 to 2. Sub UpdateVersion() With Sheets("sheet1") Sht1LastRow = Range("B" & Rows.Count).End(xlUp).Row Newrow = Sht1LastRow + 1 End With With Sheets("sheet2") RowCount = 2 Do While .Range("B" & RowCount) < "" Component = .Range("B" & RowCount) Version = .Range("C" & RowCount) With Sheets("sheet1") Set c = .Columns("B").Find(what:=Component, _ LookIn:=xlValues, lookat:=xlWhole) If c Is Nothing Then c.Offset(0, 1) = Version Else .Range("B" & Newrow) = Component .Range("C" & Newrow) = Version Newrow = Newrow + 1 End If End With RowCount = RowCount + 1 Loop End With End Sub "par4724 via OfficeKB.com" wrote: Hi again Joel, I am still struggling on this. I have looked to see if there are any typo's and there does not appear to be any. The script just puts the word "component" at the end of column B and the word "version" at the bottom of column C. Am i missing something here? Would i be able to send you an xls example? i.e Sheet 1 Column B Column C Component Version component 1 version1 component 2 version2 component 3 version3 component 4 version4 component 5 version5 component version component version component version component version component version Thanks, Paul. Joel wrote: The code is working the way it is suppose to, the data in your worksheet is bad. The code will add the new lines to sheet 1 if the Component Names don't EXACTLY match between sheets1 and sheet2. Check carefully for Extra spaces (beginning and end in Column B), Compare Capitalization in the two sheets, check for typo errors. Only the lines that don't match will be added to the end. I can modify the code to handle some of the mismatches if I knew what they were. Hi Joel, [quoted text clipped - 64 lines] Thanks and regards, Paul. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200809/1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add data from other sheet to the data present in this sheet | Excel Discussion (Misc queries) | |||
Command to update data from one sheet to another | Excel Worksheet Functions | |||
Command to update data from one sheet to another | New Users to Excel | |||
testing whether a sheet is present | Excel Programming | |||
Update data at other sheet | Excel Programming |