i have these codes which copy data from data sheet to quot sheet was working fine, but now my quot sheet has few merge cells now it dont copy. does merge cells dont copy values from single cells sheets?
VBA Code:
Sub search_quot()
Dim Quot_No As String, Fnd As Range, Ws1 As Worksheet, Ws2 As Worksheet, FileNameRef As String, X As Long, Y As Long: Y = 17
Sheets("Quot").Unprotect
Application.ScreenUpdating = False
Set Ws1 = Sheets("database")
Set Ws2 = Sheets("QUOT")
FileNameRef = Range("I3").Value
Set Fnd = Ws1.Range("A:A").Find(Ws2.Range("I3").Value, , , xlWhole, , , , , False)
If Fnd Is Nothing Then MsgBox "Quotation Number [-]> " & FileNameRef & " <[-]" & vbNewLine & "Not found in Quotation Database.", vbExclamation, "Quote Search ERROR": Exit Sub
With Ws2
.Range("I4").Value = Fnd.Offset(, 1).Value
.Range("I5").Value = Fnd.Offset(, 128).Value
.Range("C8").Value = Fnd.Offset(, 2).Value
.Range("C9").Value = Fnd.Offset(, 3).Value
.Range("A49").Value = Fnd.Offset(, 129).Value
.Range("A51").Value = Fnd.Offset(, 130).Value
.Range("H61").Value = Fnd.Offset(, 7).Value
For X = 8 To 124 Step 4
.Range("A" & Y).Resize(, 4).Value = Array(Fnd.Offset(, X).Value, Fnd.Offset(, X + 1).Value, Fnd.Offset(, X + 2).Value, Fnd.Offset(, X + 3).Value)
Y = Y + 1
Next X
End With
Range("A17").Select
ActiveWindow.ScrollRow = 1
'Sheets("Quot").Protect AllowFormattingCells:=True
Application.ScreenUpdating = True
End Sub