我将字段从工作表上的简单表单复制到包含大量数据的较大电子表格。我正在使用Lookup查找与数据关联的地址,以粘贴到该地址的行中。大多数字段都会复制,fname
和AAStatusDropDown
除外。 AAStatusDropDown
是经过验证的列表;然而,phase1
和phase2
也是如此,那些粘贴就好了。我不知道问题是什么。
Sub Data_Update()
Dim fname As Range
Dim lname As Range
Dim res_stat As Range
Dim phone As Range
Dim email As Range
Dim btype As Range
Dim p_units As Range
Dim contacted As Range
Dim crawl As Range
Dim AAStatusDropDown As Range
Dim AAStatus As Range
Dim Notes As Range
Dim Materials As Range
Dim Source As Range
Dim PHase_1 As Range
Dim Phase_2 As Range
Dim New_Note As Range
Dim Raw_Data As Worksheet
Dim GRG_Data_Entry As Worksheet
Set fname = Sheets("Data_Entry").Range("B19")
Set lname = Sheets("Data_Entry").Range("C19")
Set res_stat = Sheets("Data_Entry").Range("B20:C20")
Set phone = Sheets("Data_Entry").Range("B21")
Set email = Sheets("Data_Entry").Range("B22")
Set btype = Sheets("Data_Entry").Range("E6:F8")
Set p_units = Sheets("Data_Entry").Range("E12:F12")
Set contacted = Sheets("Data_Entry").Range("E15:F15")
Set crawl = Sheets("Data_Entry").Range("E19:F21")
Set AAStatusDropDown = Sheets("Data_Entry").Range("E27:F27")
Set AAStatus = Sheets("Data_Entry").Range("E28:F30")
Set Notes = Sheets("Data_Entry").Range("E33:F41")
Set Materials = Sheets("Data_Entry").Range("E24:F24")
Set PHase_1 = Sheets("Data_Entry").Range("E44:F44")
Set Phase_2 = Sheets("Data_Entry").Range("E45:F45")
Set Source = Sheets("Data_Entry").Range("$O$4")
Set Data_Entry = ActiveWorkbook.Worksheets("Data_Entry")
Set Raw_Data = ActiveWorkbook.Worksheets("Raw_Data")
Dim i As Integer
i = Application.Match(Source, Sheets("Raw_Data").Range("AD1:AD100"), 0)
fname.Copy
Raw_Data.Range("AM" & i).PasteSpecial xlPasteValues
lname.Copy
Raw_Data.Range("AN" & i).PasteSpecial xlValues
res_stat.Copy
Raw_Data.Range("AL" & i).PasteSpecial xlValues
phone.Copy
Raw_Data.Range("AO" & i).PasteSpecial xlValues
email.Copy
Raw_Data.Range("AP" & i).PasteSpecial xlValues
Materials.Copy
Raw_Data.Range("AI" & i).PasteSpecial xlValues
AAStatusDropDown.Copy
Raw_Data.Range("AU" & i).PasteSpecial xlValues
AAStatus.Copy
Raw_Data.Range("AT" & i).PasteSpecial xlValues
PHase_1.Copy
Raw_Data.Range("AV" & i).PasteSpecial xlValues
Phase_2.Copy
Raw_Data.Range("AW" & i).PasteSpecial xlValues
Application.CutCopyMode = False
End Sub