"Q1 2013: " & [Q1_2013] & " acres" & vbNewLine & "Q2 2013: " & [Q2_2013] & " acres" & vbNewLine & "Q3 2013: " & [Q3_2013] & " acres" & vbNewLine & "Q4 2013: " & [Q4_2013] & " acres" & vbNewLine & "Q1 2014: " & [Q1_2014] & " acres" & vbNewLine & "Q2 2014: " & [Q2_2014] & " acres" & vbNewLine & "Q3 2014: " & [Q3_2014] & " acres" & vbNewLine & "Q4 2014: " & [Q4_2014] & " acres" & vbNewLine & "2015: " & [Exp2015] & " acres" & vbNewLine & "2016: " & [Exp2016] & " acres" & vbNewLine & "2017: " & [Exp2017] & " acres" & vbNewLine & "Extension Acreage: " & [ExtAc]
Function FindLabel ( [Q1_2013] ) if ( [Q1_2013] <> 0 ) then FindLabel = "Q1 2013: " & [Q1_2013] & " acres" end if End Function
Solved! Go to Solution.
Function FindLabel( [Q1_2013], [Q2_2013], [Q3_2013] ) if ( [Q1_2013] <> 0 ) then var = "Q1 2013: " & [Q1_2013] & " acres" & vbnewline end if if ( [Q2_2013] <> 0 ) then var = var & "Q2 2013: " & [Q2_2013] & " acres" & vbnewline end if if ( [Q3_2013] <> 0 ) then var = var & "Q3 2013: " & [Q3_2013] & " acres" & vbnewline end if FindLabel = var End Function
Function FindLabel( [Q1_2013], [Q2_2013], [Q3_2013] ) if ( [Q1_2013] <> 0 ) then var = "Q1 2013: " & [Q1_2013] & " acres" & vbnewline end if if ( [Q2_2013] <> 0 ) then var = var & "Q2 2013: " & [Q2_2013] & " acres" & vbnewline end if if ( [Q3_2013] <> 0 ) then var = var & "Q3 2013: " & [Q3_2013] & " acres" & vbnewline end if FindLabel = var End Function
Function FindLabel ([Q1_2013],[Q2_2013],[Q3_2013],[Q4_2013],[Q1_2014],[Q2_2014],[Q3_2014],[Q4_2014],[Exp2015],[Exp2016],[Exp2017],[ExtAc]) y = "" if ( [Q1_2013] <> 0 ) then x = "Q1 2013: " & [Q1_2013] & " acres" y = x end if if ( [Q2_2013] <> 0 ) then x = "Q2 2013: " & [Q2_2013] & " acres" y = y & vbnewline & x end if if ( [Q3_2013] <> 0 ) then x = "Q3 2013: " & [Q3_2013] & " acres" y = y & vbnewline & x end if if ( [Q4_2013] <> 0 ) then x = "Q4 2013: " & [Q4_2013] & " acres" y = y & vbnewline & x end if if ( [Q1_2014] <> 0 ) then x = "Q1 2014: " & [Q1_2014] & " acres" y = y & vbnewline & x end if if ( [Q2_2014] <> 0 ) then x = "Q2 2014: " & [Q2_2014] & " acres" y = y & vbnewline & x end if if ( [Q3_2014] <> 0 ) then x = "Q3 2014: " & [Q3_2014] & " acres" y = y & vbnewline & x end if if ( [Q4_2014] <> 0 ) then x = "Q4 2014: " & [Q4_2014] & " acres" y = y & vbnewline & x end if if ([Exp2015] <> 0 ) then x = "2015: " & [Exp2015] & " acres" y = y & vbnewline & x end if if ([Exp2016] <> 0 ) then x = "2016: " & [Exp2016] & " acres" y = y & vbnewline & x end if if ([Exp2017] <> 0 ) then x = "2017: " & [Exp2017] & " acres" y = y & vbnewline & x end if if ([ExtAc] <> 0 ) then x = "Extension Acreage: " & [ExtAc] y = y & vbnewline & x end if FindLabel = y End Function
You can use something like thisFunction FindLabel( [Q1_2013], [Q2_2013], [Q3_2013] ) if ( [Q1_2013] <> 0 ) then var = "Q1 2013: " & [Q1_2013] & " acres" & vbnewline end if if ( [Q2_2013] <> 0 ) then var = var & "Q2 2013: " & [Q2_2013] & " acres" & vbnewline end if if ( [Q3_2013] <> 0 ) then var = var & "Q3 2013: " & [Q3_2013] & " acres" & vbnewline end if FindLabel = var End Function