LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default Macro to sort, format, sum, a dynamic set of data

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a macro to sort a complex dynamic named reference Dan Excel Programming 2 September 8th 08 01:32 PM
Merge & Sort Dynamic Lists w/ Data Validation retailmessiah Excel Discussion (Misc queries) 3 August 5th 08 04:20 PM
Merge & Sort Dynamic Lists w/ Data Validation retailmessiah Excel Worksheet Functions 3 August 5th 08 04:20 PM
dynamic sort macro across 3 linked sheets wrpalmer Excel Discussion (Misc queries) 0 December 11th 05 02:17 AM
Dynamic Sort Macro Chris Excel Programming 1 September 27th 03 11:43 PM


All times are GMT +1. The time now is 09:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"