How to fill Value in Cell if data is not available ?
Solved/Closed
Raj_1562
Posts
29
Registration date
Wednesday August 26, 2020
Status
Member
Last seen
August 29, 2022
-
Apr 23, 2021 at 09:10 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 29, 2021 at 12:03 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Apr 29, 2021 at 12:03 PM
Related:
- How to fill Value in Cell if data is not available ?
- Tmobile data check - Guide
- If cell contains date then return value ✓ - Excel Forum
- Excel "IF" function w/ date in test cell ✓ - Excel Forum
- Conditional formatting if cell contains text - Excel Forum
- Excel formula to check if cell contains a date - Excel Forum
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Apr 29, 2021 at 12:03 PM
Apr 29, 2021 at 12:03 PM
Hi Raj,
When the products that need to be autofilled are in column B and the headers are in row 1, the following code will do the job:
Best regards,
Trowa
When the products that need to be autofilled are in column B and the headers are in row 1, the following code will do the job:
Sub RunMe() Dim lRow, lRow2, x As Long x = Range("C" & Rows.Count).End(xlUp).Row + 1 lRow = Range("B1").End(xlDown).Row Do If Range("B" & lRow + 1) = vbNullString Then lRow2 = Range("B" & lRow).End(xlDown).Row If lRow2 > x Then lRow2 = x Range("B" & lRow).AutoFill Destination:=Range(Cells(lRow, "B"), Cells(lRow2 - 1, "B")) lRow = lRow2 Else lRow = lRow + 1 End If Loop Until lRow2 = x End Sub
Best regards,
Trowa