Matrix 在vba中填充矩阵

Matrix 在vba中填充矩阵,matrix,populate,Matrix,Populate,我试图从工作表的三列中填充矩阵。我的代码应该在第一列中找到一个值,将其与y轴匹配,然后在第二列中搜索一个值,将其与x轴中的列标题匹配,然后将第三列中的值粘贴到由行/列匹配激活的单元格中。有人看到我的代码有什么问题吗?我不断收到“对象变量或块变量未设置”错误: 子按钮1\u单击() Application.ScreenUpdating=False Dim filePath As String Dim strDate As String Dim strMatchJE As String Dim st

我试图从工作表的三列中填充矩阵。我的代码应该在第一列中找到一个值,将其与y轴匹配,然后在第二列中搜索一个值,将其与x轴中的列标题匹配,然后将第三列中的值粘贴到由行/列匹配激活的单元格中。有人看到我的代码有什么问题吗?我不断收到“对象变量或块变量未设置”错误:

子按钮1\u单击() Application.ScreenUpdating=False

Dim filePath As String
Dim strDate As String
Dim strMatchJE As String
Dim strMatchComponent As String
Dim wSheet As Worksheet
Dim wBook1 As Workbook

Set wSheet = ThisWorkbook.Sheets("Sheet1")

'Activate Journal Entry Number
strMatchJE = Columns("A").Find(what:="", after:=wSheet.Cells(1, 1), LookIn:=xlValues).Activate
aString = Left(originalString, 1)

strMatchJE = wSheet.Cells.Find(what:=aString, after:=Wbook.Cells(1, 1), _
            LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
            SearchDirection:=xlNext, MatchCase:=True).Address

'Activate component
strMatchComponent = Columns("B").Find(what:="", after:=wSheet.Cells(1, 1), LookIn:=xlValues).Activate
bString = Left(originalString, 1)

strMatchJE = wSheet.Cells.Find(what:=aString, after:=Wbook.Cells(2, 1), _
            LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns, _
            SearchDirection:=xlNext, MatchCase:=True).Address

strEnterAmount = Columns("T").Find(what:="", after:=wSheet.Cells(3, 1), LookIn:=xlValues).Activate

firstrow = ActiveCell.Row
firstcolumn2 = ActiveCell.Column

firstrow = firstrow + 1

Rows(firstrow).Columns(firstcolumn2).Select
strEnterAmount.Paste
端接头