admin管理员组文章数量:1192329
My vba was working perfectly fine and then all of a sudden is throwing variable mismatch errors and variable not defined errors for my next_row variable.
Sub data_input()
Dim ws_output As Sheet2
**next_row = Sheets(ws_output).Range("C" & Rows.Count).End(xlUp).Offset(1).Row**
Dim String1 As String
Dim String2 As String
Dim full_string As String
String1 = Range("Keywords").Value
String2 = Range("Other_Keywords").Value
Sheets(ws_output).Cells(next_row, 1).Value = String1 & ", " & String2
Sheets(ws_output).Cells(next_row, 2).Value = Range("Publication_Year").Value
Sheets(ws_output).Cells(next_row, 3).Value = Range("APA_Citation").Value
Sheets(ws_output).Cells(next_row, 4).Value = Range("Annotation").Value
Sheets(ws_output).Cells(next_row, 5).Value = Range("initials").Value
Range("Keywords").Value = ""
Range("Other_Keywords") = ""
Range("Publication_Year").Value = ""
Range("APA_Citation").Value = ""
Range("Annotation").Value = ""
Range("Initials").Value = ""
MsgBox "Your entry was submitted."
End Sub
I've tried defining the variable in different ways. Right now it is = to "empty" but I want it to return the row location for the rest of the code to work.
本文标签: excelVariable type mismatch in vba with finding next empty rowStack Overflow
版权声明:本文标题:excel - Variable type mismatch in vba with finding next empty row - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738464536a2088224.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论