Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to use vba to automate some stuff. Part of it includes
autocopying a formula in a row to a row which is identified by a number calculated in cell AC18. Currently the only reason for AC18 is for that calculation. I would like to delete it and add it to the code. However I am not sure how to do this. Do I need to make a dim statement? Does it need to have a name according to some vba rules or can I make up a name? Currently the AC18 formula is =counta(k:k) Any help would be greatly appreciated. TIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this
Sub test() Dim rw As Long With Sheets("Sheet1") rw = Application.WorksheetFunction.CountA(.Columns("K:K ")) ' copy the formula in B1 to B? ..Range("B1").Copy .Cells(rw, "B") End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Papa Jonah" wrote in message ... I am trying to use vba to automate some stuff. Part of it includes autocopying a formula in a row to a row which is identified by a number calculated in cell AC18. Currently the only reason for AC18 is for that calculation. I would like to delete it and add it to the code. However I am not sure how to do this. Do I need to make a dim statement? Does it need to have a name according to some vba rules or can I make up a name? Currently the AC18 formula is =counta(k:k) Any help would be greatly appreciated. TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding code to a macro | Excel Worksheet Functions | |||
adding and subtracting using vb code | Excel Discussion (Misc queries) | |||
Automate adding code | Excel Programming | |||
Adding space to VBA code | Excel Programming | |||
Adding image with code | Excel Programming |