我需要将两个VBA代码转移到Google表格中,但由于级别有限,我自己不能这样做,请帮助我...谢谢
Private Sub Save_Click()
Dim MyStr As String
Dim rng As Range
MyStr = "C5:F5"
Set rng = Range(MyStr)
If Application.CountA(rng) <> rng.Cells.Count Then
MsgBox "Error: data can not be empty in cells marked with * !", , "SA
MOAY ?!"
Exit Sub
End If
SaveBHN
End Sub
并且:
Sub SaveBHN()
Dim Sh As Worksheet, rng As Range, sRng As Range
Set Sh = Sheets("D")
Set rng = Sh.Range(Sh.[A7], Sh.[A13006].End(xlUp))
Set sRng = rng.Find([A5].Value, , xlFormulas, xlWhole)
If Not sRng Is Nothing Then
sRng.Offset(, 38).Resize(, 4).Value = Range("C5:F5").Value
HN.Range("C5:F5").ClearContents
Else
MsgBox "Nothing"
End If
End Sub