The whole point of doing this is to remove the blanks where 0 appeared.
So I guess my only option is to do this in VBA. Time to roll up my
sleaves I guess. Has anyone done anything similar that they can share
to help get me started?
> There are two possibilities.
>
[quoted text clipped - 44 lines]
> >
> > Thanks in advance for your help.
This is a macro doing almost the same as what you did manually, doing a
filter, then copy/paste etc.
copy the code below to standard module. after selecting your Worksheet 1,
run myfilter, then this will create none zero value in Worksheet 2.
assuming item# in A1, Name in B1, Value in C1 and the name of Worksheet 2 is
Sheet2.
Sub myfilter()
Dim srcsheet As Worksheet
Dim dstsheet As Worksheet
Dim n As Long
Const itemad = "a1" 'change - item# address
Const valad = "c1" 'change - value address
On Error Resume Next
Application.ScreenUpdating = False
Set srcsheet = ActiveSheet
Set dstsheet = Worksheets("Sheet2") 'change - Worksheet2
n = Range(valad).Column - Range(itemad).Column + 1
dstsheet.Cells.Clear
Range(valad).AutoFilter Field:=n, Criteria1:=">0", Operator:=xlAnd
srcsheet.AutoFilter.Range.Copy destination:=dstsheet.Cells(1, 1)
srcsheet.AutoFilterMode = False
Application.EnableEvents = True
End Sub
if you want to update table in Worksheet 2 automatically when you change
values of table in Worksheet 1, copy the code below to Worksheet 1
module(Sheet1?, not sure), not standard module.
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
myfilter
Application.EnableEvents = True
End Sub
keizi
> The whole point of doing this is to remove the blanks where 0 appeared.
> So I guess my only option is to do this in VBA. Time to roll up my
[quoted text clipped - 49 lines]
>> >
>> > Thanks in advance for your help.
yofnik@comcast.net - 30 Sep 2006 23:36 GMT
GREAT! Thank you so much.
> This is a macro doing almost the same as what you did manually, doing a
> filter, then copy/paste etc.
[quoted text clipped - 86 lines]
> >> >
> >> > Thanks in advance for your help.