LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Update sheet one if data is not present.

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
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
Add data from other sheet to the data present in this sheet Nemo Excel Discussion (Misc queries) 1 January 29th 10 07:49 AM
Command to update data from one sheet to another Yitzhack Excel Worksheet Functions 6 June 25th 08 05:48 AM
Command to update data from one sheet to another Yitzhack New Users to Excel 1 June 25th 08 04:35 AM
testing whether a sheet is present Jeff Excel Programming 3 August 14th 05 04:07 PM
Update data at other sheet broogle Excel Programming 0 August 9th 05 04:54 AM


All times are GMT +1. The time now is 07:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"