Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to set a macro to format Columns that will have varying number of
rows each time I run the program. I need to add some columns and fill in the formulas to the last populated row. I have been trying a few different styles but I can't get the ultimate result. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like the following:
Sub AAA() Const C_WHAT_COLUMN = "A" Const C_START_ROW = 1 Const C_NUMBER_OF_COLUMNS = 4 Dim LastRow As Long Dim Rng As Range LastRow = Cells(Rows.Count, C_WHAT_COLUMN).End(xlUp).Row Set Rng = Range(Cells(C_START_ROW, C_WHAT_COLUMN), _ Cells(LastRow, C_WHAT_COLUMN)).Resize(, C_NUMBER_OF_COLUMNS) Rng.FillRight End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email on the web site) "Keep It Simple Stupid" wrote in message ... I am trying to set a macro to format Columns that will have varying number of rows each time I run the program. I need to add some columns and fill in the formulas to the last populated row. I have been trying a few different styles but I can't get the ultimate result. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
activate formula when adjacent cell populated | Excel Worksheet Functions | |||
Formula to display last entry in a column populated with #N/As | Excel Worksheet Functions | |||
Payment cell populated based on date formula | Excel Discussion (Misc queries) | |||
inserting a formula next to populated cells | Excel Programming | |||
A SIMPLER FORMULA TO GET A REFERENCE OF WHICH COLUMN IS POPULATED | Excel Worksheet Functions |