Excel" Hide mutiple columns based on the date input in a cell -


private sub worksheet_change(byval target range)     if target.cells.count = 1 , target.address = "$a$1"        if lcase(target.value) = a1 = d3          columns("i:di").entirecolumn.hidden = true       elseif lcase(target.value) = a1 = i3          columns("d:h").entirecolumn.hidden = true          columns("n:di").entirecolumn.hidden = true       elseif lcase(target.value) = a1 = n3          columns("d:").entirecolumn.hidden = true          columns("n:di").entirecolumn.hidden = true       else          columns("a:di").entirecolumn.hidden = false       end if     end if  end sub 

whatever date enter in cell a1, hides i:di

i very newbie vba's , macros.

thanks in advance help.


from comment:

i want hide multiple columns based on cell input. example, when enter 09/09/2017 in a1, if date matches date in column 'd' hide after column di. similarly, if enter 10/09/2017 in a1, if date matches date in column 'i', hide columns d h , column m di.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -