Click here to Skip to main content
15,916,379 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionmultithreads Pin
Member 1306030229-Mar-17 20:41
Member 1306030229-Mar-17 20:41 
AnswerRe: multithreads Pin
Chris Quinn29-Mar-17 21:29
Chris Quinn29-Mar-17 21:29 
GeneralRe: multithreads Pin
Member 1306030229-Mar-17 22:16
Member 1306030229-Mar-17 22:16 
GeneralRe: multithreads Pin
Chris Quinn29-Mar-17 22:18
Chris Quinn29-Mar-17 22:18 
GeneralRe: multithreads Pin
Member 1306030229-Mar-17 23:59
Member 1306030229-Mar-17 23:59 
Questionimporting excel file to sql server Pin
Member 1305213529-Mar-17 8:31
Member 1305213529-Mar-17 8:31 
AnswerRe: importing excel file to sql server Pin
Member 1303625129-Mar-17 9:50
Member 1303625129-Mar-17 9:50 
QuestionMacro to hide rows and columns with zero values Pin
Member 1308978628-Mar-17 3:07
Member 1308978628-Mar-17 3:07 
I need a macro that will hide and unhide rows and columns that contain all zero values. I strated with the following code that hide and unhide columns with zero but it does not work. Does anyone know how to fix it.


Sub HideEmptyColumns()
' This macro hides empty or all-zero columns in the active worksheet
' It ignores columns outside the used range (UsedRange)
Dim Col As Range
For Each Col In ActiveSheet.UsedRange.Columns
Col.EntireColumn.Hidden = AllZero(Col)
Next Col
End Sub
Sub UnhideColumns()
' This macro unhides all columns on the active worksheet
Columns.Hidden = False
End Sub
Function AllZero(R As Range) As Boolean
' This function returns TRUE if the range is entirely empty or all zero
Dim C As Range
AllZero = True
For Each C In R.Cells
If C.Value <> 0 Then
AllZero = False
Exit For
End If
Next C
End Function

QuestionRe: Macro to hide rows and columns with zero values Pin
CHill6028-Mar-17 3:38
mveCHill6028-Mar-17 3:38 
AnswerRe: Macro to hide rows and columns with zero values Pin
Member 1308978628-Mar-17 3:41
Member 1308978628-Mar-17 3:41 
AnswerRe: Macro to hide rows and columns with zero values Pin
CHill6028-Mar-17 3:58
mveCHill6028-Mar-17 3:58 
GeneralRe: Macro to hide rows and columns with zero values Pin
Member 1308978628-Mar-17 10:53
Member 1308978628-Mar-17 10:53 
AnswerRe: Macro to hide rows and columns with zero values Pin
ZurdoDev29-Mar-17 1:04
professionalZurdoDev29-Mar-17 1:04 
QuestionDES Coding on visual studio 2010 Pin
Member 1307673422-Mar-17 2:31
Member 1307673422-Mar-17 2:31 
GeneralRe: DES Coding on visual studio 2010 Pin
Ralf Meier22-Mar-17 3:13
mveRalf Meier22-Mar-17 3:13 
AnswerRe: DES Coding on visual studio 2010 Pin
Jochen Arndt22-Mar-17 3:14
professionalJochen Arndt22-Mar-17 3:14 
QuestionClient/Server Application - Locating Server on Network Pin
Dominick Marciano15-Mar-17 12:37
professionalDominick Marciano15-Mar-17 12:37 
SuggestionRe: Client/Server Application - Locating Server on Network Pin
Richard MacCutchan15-Mar-17 22:43
mveRichard MacCutchan15-Mar-17 22:43 
AnswerRe: Client/Server Application - Locating Server on Network Pin
Bernhard Hiller15-Mar-17 23:17
Bernhard Hiller15-Mar-17 23:17 
AnswerRe: Client/Server Application - Locating Server on Network Pin
Dave Kreskowiak16-Mar-17 3:05
mveDave Kreskowiak16-Mar-17 3:05 
QuestionSerial device attached to USB 3.0 port not behaving same as when attached to USB2.0 Pin
SepPax10-Mar-17 6:56
SepPax10-Mar-17 6:56 
SuggestionRe: Serial device attached to USB 3.0 port not behaving same as when attached to USB2.0 Pin
CHill6010-Mar-17 11:41
mveCHill6010-Mar-17 11:41 
QuestionRandom Number Generator Pin
Member 1303025428-Feb-17 20:06
Member 1303025428-Feb-17 20:06 
AnswerRe: Random Number Generator Pin
OriginalGriff28-Feb-17 20:09
mveOriginalGriff28-Feb-17 20:09 
AnswerRe: Random Number Generator Pin
Patrice T3-Mar-17 15:28
mvePatrice T3-Mar-17 15:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.