Vba : Insert Number Into Only No Color Cell Background

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Vba : Insert Number Into Only No Color Cell Background

Post by Susanto3311 »

hi all..

i,m looking for vba code to input/insert number from cell M13 till M90 into only no coloring cell but skip/pass certainty cell (coloring cell). My background cell are multiple colors
With step like this:
- select your range..
- entry/input your number ..

here attachment picture
i hope someone would help me solution.
.susant
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78455
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Vba : Insert Number Into Only No Color Cell Background

Post by HansV »

Select the range before running the following macro:

Code: Select all

Sub EnterUncolored()
    Dim v As Variant
    Dim c As Range
    v = InputBox("Which value do you want to enter?")
    If v = "" Then Exit Sub
    Application.ScreenUpdating = False
    For Each c In Selection
        If c.Interior.ColorIndex = xlColorIndexNone Then
            c.Value = v
        End If
    Next c
    Application.ScreenUpdating = True
End Sub
Best wishes,
Hans

Susanto3311
3StarLounger
Posts: 240
Joined: 17 Feb 2022, 05:16

Re: Vba : Insert Number Into Only No Color Cell Background

Post by Susanto3311 »

hi Hans, thank you very much..Working well.