Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet that I need to reformat each month in order for it to be
imported into another application. The spreadsheet varies in length each month, from say 100 lines one month to 600 lines the following month. I have recorded a macro that deletes columns, creates formulae etc. I wish to 'auto fill' the formulae I create down the entire length of a column. However, the fact that the spreadsheet has a different number of lines each month means that performing the autofill via a simple macro does not work. I know there is a bit of code that will allow me to find the last line in the spreadsheet and autofill down to that line but I can't remember how to do it. Any suggestions? Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is an example code:
Range("B2").Formula = "=LOOKUP(A2,'Employee Numbers'!C:D)" If Range("A3") "" Then Range("B2", Range("A2").End(xlDown)).Offset(0, 1).FillDown End If This uses the last row of column A [Range("A2").End(xlDown))] as where to fill down the formula in column B from B2. Mike F "bernard" wrote in message ... I have a spreadsheet that I need to reformat each month in order for it to be imported into another application. The spreadsheet varies in length each month, from say 100 lines one month to 600 lines the following month. I have recorded a macro that deletes columns, creates formulae etc. I wish to 'auto fill' the formulae I create down the entire length of a column. However, the fact that the spreadsheet has a different number of lines each month means that performing the autofill via a simple macro does not work. I know there is a bit of code that will allow me to find the last line in the spreadsheet and autofill down to that line but I can't remember how to do it. Any suggestions? Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!
"Mike Fogleman" wrote: Here is an example code: Range("B2").Formula = "=LOOKUP(A2,'Employee Numbers'!C:D)" If Range("A3") "" Then Range("B2", Range("A2").End(xlDown)).Offset(0, 1).FillDown End If This uses the last row of column A [Range("A2").End(xlDown))] as where to fill down the formula in column B from B2. Mike F "bernard" wrote in message ... I have a spreadsheet that I need to reformat each month in order for it to be imported into another application. The spreadsheet varies in length each month, from say 100 lines one month to 600 lines the following month. I have recorded a macro that deletes columns, creates formulae etc. I wish to 'auto fill' the formulae I create down the entire length of a column. However, the fact that the spreadsheet has a different number of lines each month means that performing the autofill via a simple macro does not work. I know there is a bit of code that will allow me to find the last line in the spreadsheet and autofill down to that line but I can't remember how to do it. Any suggestions? Thanks in advance |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a question about this Macro
My understanding is it looks at column A to determine how far to fill Column B starting with cell B2. What exactly does this portion "=LOOKUP(A2,'Employee Numbers'!C:D)" Have to do with it...I am getting some sort of error when I attempt to use this macro in my spreadsheet "Mike Fogleman" wrote: Here is an example code: Range("B2").Formula = "=LOOKUP(A2,'Employee Numbers'!C:D)" If Range("A3") "" Then Range("B2", Range("A2").End(xlDown)).Offset(0, 1).FillDown End If This uses the last row of column A [Range("A2").End(xlDown))] as where to fill down the formula in column B from B2. Mike F "bernard" wrote in message ... I have a spreadsheet that I need to reformat each month in order for it to be imported into another application. The spreadsheet varies in length each month, from say 100 lines one month to 600 lines the following month. I have recorded a macro that deletes columns, creates formulae etc. I wish to 'auto fill' the formulae I create down the entire length of a column. However, the fact that the spreadsheet has a different number of lines each month means that performing the autofill via a simple macro does not work. I know there is a bit of code that will allow me to find the last line in the spreadsheet and autofill down to that line but I can't remember how to do it. Any suggestions? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto filling Forms | Excel Worksheet Functions | |||
Auto Filling | Excel Worksheet Functions | |||
Auto filling a row | Excel Discussion (Misc queries) | |||
Auto Filling one sheet from another | Excel Worksheet Functions | |||
Auto Protecting cells & auto filling date | Excel Discussion (Misc queries) |