Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is something similar (as I understand it). I have some users
who, after manipulating copies of pivot tables, want to fill the empty cells under each grouping. I welcome any critique to this approach Sub Copy_down2() 'Copy cell above to current cell and empty cells below ' make the range wider by adjusting the column offset, where 0 = current Dim rng_frm As Range, rng_to As Range, intCO As Integer, intLC As Long intCO = 0 ' column offset intLC = ActiveSheet.Rows.Count Do While ActiveCell.Row < intLC If IsEmpty(ActiveCell) Then Set rng_frm = Range(Cells(ActiveCell.Row - 1, ActiveCell.Column).Address _ & ":" & Cells(ActiveCell.Row - 1, ActiveCell.Column + intCO).Address) Set rng_to = Range(Cells(ActiveCell.Row, ActiveCell.Column).Address _ & ":" & IIf(IsEmpty(ActiveCell(2)), (Cells (ActiveCell.End(xlDown).Row - 1, ActiveCell.Column).Address), (Cells (ActiveCell.Row, ActiveCell.Column).Address))) rng_frm.Copy rng_to Cells(ActiveCell.End(xlDown).Row, ActiveCell.Column).Select End If ActiveCell(2).Select If ActiveCell.End(xlDown).Row = intLC Then Exit Sub End If Loop End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Take part data from two fields and auto fill into 3rd field | Excel Worksheet Functions | |||
Using Macro to fill up data in coulmn | Excel Programming | |||
Fill in field | Excel Discussion (Misc queries) | |||
Macro to Copy data from e-mail and paste it into a field on a website | Excel Programming | |||
Macro Auto-Fill Field. | Excel Programming |