Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
My question is if it is possible to program a VB script that ca autofill all the cells. I want to create a Pivot table, but the cells are not filled in all. So for example in colom A there is Name: Erik in A2 Then A1 to A10 are empty but there should be Erik there to. In B2 there is Sport And in C2 there is the actual sport name. So The B2 name Sport should be extended further. I used this code, but then I will have to select all the Ranges wit hand and type it in. Is there a way I can let the script run untill there is a filled i cell and do so for all the coloms? Range("C17").Select Selection.AutoFill Destination:=Range("C17:C19"), Type:=xlFillCopy Range("C17:C19").Select Range("C21").Select Range("D17").Select Selection.AutoFill Destination:=Range("D17:D19"), Type:=xlFillCopy Range("D17:D19").Select Range("D21").Selec -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dim crow = Cells(Rows.Count,"C").End(xlUp).Row-1 Range("C17").AutoFill Destination:=Range("C17:C" & cRow), Type:=xlFillCopy etc. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Hello, My question is if it is possible to program a VB script that can autofill all the cells. I want to create a Pivot table, but the cells are not filled in all. So for example in colom A there is Name: Erik in A2 Then A1 to A10 are empty but there should be Erik there to. In B2 there is Sport And in C2 there is the actual sport name. So The B2 name Sport should be extended further. I used this code, but then I will have to select all the Ranges with hand and type it in. Is there a way I can let the script run untill there is a filled in cell and do so for all the coloms? Range("C17").Select Selection.AutoFill Destination:=Range("C17:C19"), Type:=xlFillCopy Range("C17:C19").Select Range("C21").Select Range("D17").Select Selection.AutoFill Destination:=Range("D17:D19"), Type:=xlFillCopy Range("D17:D19").Select Range("D21").Select --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tx for the quick reply
When I put Dim crow = Cells(Rows.Count,"C").End(xlUp).Row-1 Range("C17").AutoFil Destination:=Range("C17:C" & cRow), Type:=xlFillCopy I get the error: Expected: End of Statement Is it also possible for the script to run until a new value is foun and then continue the autofill with that new value -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The newsreader may have wrapped it around. It should all be on one line.
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... Tx for the quick reply When I put Dim crow = Cells(Rows.Count,"C").End(xlUp).Row-1 Range("C17").AutoFill Destination:=Range("C17:C" & cRow), Type:=xlFillCopy I get the error: Expected: End of Statement Is it also possible for the script to run until a new value is found and then continue the autofill with that new value? --- Message posted from http://www.ExcelForum.com/ |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can't see the wood for the trees<g. Try this
Dim crow As Long crow = Cells(Rows.Count, "C").End(xlUp).Row - 1 Range("C17").AutoFill Destination:=Range("C17:C" & crow), Type:=xlFillCopy -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Vliegveld " wrote in message ... still the same error comes up --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
simple question on formulas and autofil | Excel Worksheet Functions | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
question about some excel restriction script running on ... | Excel Discussion (Misc queries) | |||
Autofil a cell in the same row. | Excel Worksheet Functions | |||
Filling cells (autofil?) in Excel 2003 | Excel Discussion (Misc queries) |