Merging 3 odules into 1

jackofalltrades2011

New Member
Joined
Jun 24, 2011
Messages
4
Hello GANG!

I have 3 modules I am trying to merge into 1...they are:

Sub WriteOffs()
'
' WriteOffs Macro
' maniplute Imported Oracle Data for write-offs
'
'
Columns("J:L").Select
Selection.Delete Shift:=xlToLeft
Columns("J:J").Select
Selection.Cut
Columns("C:C").Select
Selection.Insert Shift:=xlToRight
Columns("J:J").Select
Selection.NumberFormat = "0.00_);[Red](0.00)"
Rows("1:1").Select
Selection.AutoFilter
Range("A2").Select
ActiveWindow.FreezePanes = True

End Sub

Sub rec_inv()
'
' rec_inv Macro
' sort by rec and inv
'
Range("A1:L1048576").Select
Range("A2").Activate

ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Add Key:=Range("K:K") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Add Key:=Range("G:G") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("H5944BB").Sort
.SetRange Range("A1:L1048576")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

End Sub

*** Then I have to manually move information from column K to column G (can I write a procedrue for that?) ***

lastly,

Sub doc_write()
'
' doc_write Macro
' Sort by doc date and w/o date
'
'
Range("A1:L1048576").Select
Range("G2").Activate
ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Add Key:=Range("F:F") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("H5944BB").Sort.SortFields.Add Key:=Range("K:K") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("H5944BB").Sort
.SetRange Range("A1:L1048576")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub

SO...From beginning to end--I need to get data from a text file, delete some of the columns, sort the rec_inv column numbers, move the sorted REC numbers into the blank INV numbers column, then sort by Doc_Write without having to change the activeworkbook.worksheets NAME each time I run the last 2 subs....
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top