Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good Day
I process a data that is extracted from a loan system through a data mining app. I do as much formatting in that app as I can before expoting to excel. I'm trying to write a macro that will do all the formatting I need. I can actually record the macro to do exactly what I want, EXCEPT, there are multiple ranges of data, that may be there one day, but not the next. I really have very limited exp. with macros, other than recording, and I just don't have a clue how to do this. Here is a portion of the code: Sub FINX_FORMAT() ' ' FINX_FORMAT Macro ' ' Columns("K:K").Select Selection.Cut Columns("P:P").Select ActiveSheet.Paste Columns("K:K").Select Selection.Delete Shift:=xlToLeft Range("A1").Select Selection.CurrentRegion.Select Selection.Sort Key1:=Range("H2"), Order1:=xlAscending, Key2:=Range("D2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal Range("A1").Select Selection.End(xlDown).Select Range("J23:N23").Select With Selection.Font .Name = "Tahoma" .FontStyle = "Bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 1 End With Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With With Selection.Borders(xlInsideVertical) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With Range("K23").Select ActiveCell.FormulaR1C1 = "=SUM(R[-21]C:R[-1]C)" Selection.AutoFill Destination:=Range("K23:N23"), Type:=xlFillDefault Range("K23:N23").Select Selection.End(xlToLeft).Select I basically need to repeat this same steps over and over, again with the understanding that the date will change from day to day. I would so appreciate some assistance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating a macro to sort a complex dynamic named reference | Excel Programming | |||
Merge & Sort Dynamic Lists w/ Data Validation | Excel Discussion (Misc queries) | |||
Merge & Sort Dynamic Lists w/ Data Validation | Excel Worksheet Functions | |||
dynamic sort macro across 3 linked sheets | Excel Discussion (Misc queries) | |||
Dynamic Sort Macro | Excel Programming |