Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
For example I have a macro that sorts data from A1 to D5. Is there a way for
this macro to pick up an extra line. Say I copied row 1, and then pasted it under row 1, so therefore, I would want the macro to sort from A1 to D6. Is there a way for the macro to automatically update itself, instead of me going through all macros to update the selected range? Thank you. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could add a simple routine to count the rows. Assuming data always
present in column "A" r=1 Do while not IsEmpty(Sheets(".......").Cells(t,1)) r=r+1 Loop sortRange =("A1:D" & r) "doral" wrote: For example I have a macro that sorts data from A1 to D5. Is there a way for this macro to pick up an extra line. Say I copied row 1, and then pasted it under row 1, so therefore, I would want the macro to sort from A1 to D6. Is there a way for the macro to automatically update itself, instead of me going through all macros to update the selected range? Thank you. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
enter formula below in a cell say E1 and then link the counter in your Macro to this cell (E1): =COUNTA(A1:A1000) assumed column A should not be blank in your data range for example if your datarange is A1:D100 column A Cells between this range shouldn't be blank Thanks, -- Farhad Hodjat "doral" wrote: For example I have a macro that sorts data from A1 to D5. Is there a way for this macro to pick up an extra line. Say I copied row 1, and then pasted it under row 1, so therefore, I would want the macro to sort from A1 to D6. Is there a way for the macro to automatically update itself, instead of me going through all macros to update the selected range? Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Protect / Block selected worksheet area . | Excel Discussion (Misc queries) | |||
setting print area to selected cells | Excel Discussion (Misc queries) | |||
Multiple pages after printing selected area | Excel Discussion (Misc queries) | |||
I want to change the selected print area but it will not allow me | Excel Worksheet Functions | |||
Capitalizing selected area | Excel Discussion (Misc queries) |