Hi
Can you help with a quicker method to update the cells, I'm trying to add a value from one sheet to increase the value across a range on another sheet, whilst skipping any blank cells.
Here's the code I have which works, but takes ridiculously long
Thank you
Can you help with a quicker method to update the cells, I'm trying to add a value from one sheet to increase the value across a range on another sheet, whilst skipping any blank cells.
Here's the code I have which works, but takes ridiculously long
VBA Code:
Sub testprices()
Dim rng As Range, r As Range
Dim datasheet As Worksheet, detailssheet As Worksheet
Set datasheet = ThisWorkbook.Sheets(2)
Set detailssheet = ThisWorkbook.Sheets(3)
Lastrow = datasheet.Range("A" & Rows.Count).End(xlUp).Row
Set rng = datasheet.Range("O2:U" & Lastrow)
For Each r In rng
If r.Value <> "" Then
r.Value = r.Value + detailssheet.Range("B9").Value
End If
Next r
MsgBox ("complete")
End Sub
Thank you