Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109602

Re: Fill Cell with Colour if Q

From Claus Busch <claus_busch@t-online.de>
Newsgroups microsoft.public.excel.programming
Subject Re: Fill Cell with Colour if Q
Date 2016-11-17 17:26 +0100
Organization A noiseless patient Spider
Message-ID <o0kln6$nv4$1@dont-email.me> (permalink)
References <86c817e5-f3c4-44bc-a475-449d0738ec27@googlegroups.com> <o0kikh$cfa$1@dont-email.me> <30b37c9e-3ac8-45d3-b4ec-a117e2eab435@googlegroups.com>

Show all headers | View raw


Hi Sean,

Am Thu, 17 Nov 2016 07:47:16 -0800 (PST) schrieb seanryanie@yahoo.co.uk:

> Fantastic Claus (again) works like a dream

if you have a huge amount of rows try:

Sub FillColor2()
Dim LRow As Long, i As Long
Dim varCheck As Variant, varData As Variant
Dim strCheck As String

varCheck = Range("Products")
With Application
    strCheck = Join(.Index(.Transpose(varCheck), 1, 0), ",")
End With
    
With ActiveSheet
    LRow = .Cells(.Rows.Count, "E").End(xlUp).Row
    varData = .Range("E1:E" & LRow)
    For i = LBound(varData) To UBound(varData)
        If InStr(strCheck, varData(i, 1) & ",") Then
            .Cells(i, "F").Interior.Color = vbYellow
            .Cells(i, "M").Interior.Color = vbYellow
        End If
    Next
End With
End Sub

This macro is a little bit faster


Regards
Claus B.
-- 
Windows10
Office 2016

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Fill Cell with Colour if Q seanryanie@yahoo.co.uk - 2016-11-17 07:22 -0800
  Re: Fill Cell with Colour if Q Claus Busch <claus_busch@t-online.de> - 2016-11-17 16:34 +0100
    Re: Fill Cell with Colour if Q seanryanie@yahoo.co.uk - 2016-11-17 07:47 -0800
      Re: Fill Cell with Colour if Q Claus Busch <claus_busch@t-online.de> - 2016-11-17 17:26 +0100
        Re: Fill Cell with Colour if Q seanryanie@yahoo.co.uk - 2016-11-17 10:45 -0800
  Re: Fill Cell with Colour if Q bulong <bulong@gmail.com> - 2016-11-18 16:02 +0000

csiph-web