0

Hi everyone I'm just curious about why this code works and the next one doesn't here it goes:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As String
cell = Sheets("IntQ").Range("A5").Value
 If cell = "" Then
  cell = "This should work"
  Sheets("IntQ").Range("A5").Value = cell
 End If
End Sub

Here goes the code that doesn't work:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim cell As Range
cell = Sheets("IntQ").Range("A5")
 If cell.Value = "" Then
  cell.Value = "Elige la marca del producto"
 End If
End Sub

The prompt says that the cell variable value is null

0 Answers0