Hi all,
Another question I'm hoping to get answered by the community!
My need (see attached file to work with):
1. Check each cell value in sheet LWDB column A to the column A in sheet MyDB
2. If found take that cell values entire row of data (LWDB sheet), insert data row below found value (MyDB sheet) and offset one column (being data to start in column B)
3. If cell value in LWDB not found, add that value to list (with formatting in MyDB) to MyDB then add the LWDB row below it
4. Continue through loop to all items have been addressed.
My code:
Sub Databasing()
'
' Databasing Macro
'
'
Dim c As Range, d As Range
Worksheets("LWDB").Activate
For Each c In Range("A2:A15")
For Each d In Worksheets("MyDB").Range("A2:A30")
If c = d Then
c.EntireRow.Copy
d.Offset(1, 0).Insert Shift:=xlShiftUp, CopyOrigin:=True
End If
Next
Next
End Sub
My thoughts: I have had my code work for points 1 & 2 on sample of 5, however the matching code crashes due to processing past this amount! Would it be better to use some sort of Array or any other thoughts on cutting this down as the databasing could be up to 400 entries.
Appreciate the help
Bookmarks