S
StevenM
Here is a snippet of working code:
--------------------------------------------------------------------------------------
' change all blank task ids with worktype Release to a lookup based
' on taskname
Selection.AutoFilter Field:=7, Criteria1:="="
Selection.AutoFilter Field:=6, Criteria1:="Release"
firstrow = getfirstrow()
lastrow = getlastrow("F")
Range("G" & firstrow).Select
ActiveCell.Value = "=VLOOKUP($H" & firstrow &
",TaskNameIds.xls!TasknameIdTbl,2,FALSE)"
Selection.Copy
Range("G" & firstrow & ":G" & lastrow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
'Clear the filters and copy in all of G to get the values for the lookups
Selection.AutoFilter Field:=6
Selection.AutoFilter Field:=7
firstrow = getfirstrow()
lastrow = getlastrow("G")
Range("G" & firstrow & ":G" & lastrow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
' change all blank task names to the investment names for ID* projects
Selection.AutoFilter Field:=8, Criteria1:="="
Selection.AutoFilter Field:=4, Criteria1:="ID*
--------------------------------------------------------------------------------------
I am trying to find a way to do it more efficiently. The spreadsheet this
is operating on has about 12000+ rows. I originally tried to copy the
copy/paste special/values on the filtered data. I got an error saying the
copy area and paste area are not the same size and shape. So I cleared the
filter and selected the column from first row to last row and copy/paste
special. It works but it takes a very long time to do as it is operating on
12000+ rows, even though only some of
those rows actually has a formula.
How can I leave the filter on, and step through the range of visible cells
to do the copy/pastespecial? Will that be more efficient/faster?
TIA.
--------------------------------------------------------------------------------------
' change all blank task ids with worktype Release to a lookup based
' on taskname
Selection.AutoFilter Field:=7, Criteria1:="="
Selection.AutoFilter Field:=6, Criteria1:="Release"
firstrow = getfirstrow()
lastrow = getlastrow("F")
Range("G" & firstrow).Select
ActiveCell.Value = "=VLOOKUP($H" & firstrow &
",TaskNameIds.xls!TasknameIdTbl,2,FALSE)"
Selection.Copy
Range("G" & firstrow & ":G" & lastrow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
'Clear the filters and copy in all of G to get the values for the lookups
Selection.AutoFilter Field:=6
Selection.AutoFilter Field:=7
firstrow = getfirstrow()
lastrow = getlastrow("G")
Range("G" & firstrow & ":G" & lastrow).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
' change all blank task names to the investment names for ID* projects
Selection.AutoFilter Field:=8, Criteria1:="="
Selection.AutoFilter Field:=4, Criteria1:="ID*
--------------------------------------------------------------------------------------
I am trying to find a way to do it more efficiently. The spreadsheet this
is operating on has about 12000+ rows. I originally tried to copy the
copy/paste special/values on the filtered data. I got an error saying the
copy area and paste area are not the same size and shape. So I cleared the
filter and selected the column from first row to last row and copy/paste
special. It works but it takes a very long time to do as it is operating on
12000+ rows, even though only some of
those rows actually has a formula.
How can I leave the filter on, and step through the range of visible cells
to do the copy/pastespecial? Will that be more efficient/faster?
TIA.