#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Macro

I have a data set that is manipulated by a macro (data1) to set certain
columns in order so as to read them into another spreadsheet. Once the macro
(data1) has run it sorts by column J, then highlights J1 and K1 and stops.
The reason it stops is I have to select the contents that are in Col J that
have a value of 1 or less and then delete those contents of the selected
cells and those cells that are adjacent to the selected values in Col j in
Col K. I then run another macro (data2) that deletes all of Col J, sorts by
Col L and then highlights Col L1 and Col M1 and stops. The process continues
until I complete Col R and Col S (data6). Then I run the last macro (data7)
which does the final manipulation.

I would first like to be able to create a macro that sorts, removes the
contents and the adjacent contents (K) in this instance, then deletes the
first column, (J) in this instance, then sorts the next columns and repeats
itself until it comes up to another macro at the end that does the final
manipulations ( the first and last macros are constantly changing somewhat
depending on the data uploaded. All in all, I would like to create the
sorting and deleting macros that I do manually now then be able to tie all of
the macros into one. And, how do you tie the end of one to the beginning of
another.

This is an snapshot example of the data once it is first manipulated by
(data1) and ready to have the values =<1 along with the adjacent value
deleted in Col J and K. Notice there is a value (2) in J that would not be
deleted and only requires a clear content at first then a complete deletion
of Col J. The purpose is to rid the values in K that have a value attributed
to anything 1 or less in J.

I J K L
M
Distance FirstCall FirstCallLenAdj SecondCall SecondCallLenAdj
1 6.00 .50 0.54 0.50 0.25
2 6.00 1.00 0.35 0.50 0.32
3 6.00 1.00 0.26 1.00 0.45
4 6.00 2.00 0.32 2.00 0.78


This is the end of (data1) as it stops,

Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Cells.Select
Selection.Sort Key1:=Range("J2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("J2:K2").Select

This is macro2 thru macro6 only the names and col# change accordingly

Sub Data2()
'
' Data2 Macro
' Macro recorded 08/07/2006 by User
'
' Keyboard Shortcut: Ctrl+w
'
Columns("J:J").Select
Selection.Delete Shift:=xlToLeft
Cells.Select
Selection.Sort Key1:=Range("K2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("K2:L2").Select
End Sub


This is the beginning of (data7)

Data7 Macro
' Macro recorded 09/06/2006 by User
'
' Keyboard Shortcut: Ctrl+u
'
Range("A1:R1").Select
Selection.Font.ColorIndex = 15
Selection.Font.ColorIndex = 1
Rows("2:2").Select
ActiveWindow.FreezePanes = False
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro

Are we to understand that you want to clear the contents of any cell in col
F thru col S and the cell to the right if the cell cell value is <1. If so,
you are going to a lot of trouble.?? Perhaps a re-stating of the entire
problem.?

--
Don Guillett
SalesAid Software

"Shu of AZ" wrote in message
...
I have a data set that is manipulated by a macro (data1) to set certain
columns in order so as to read them into another spreadsheet. Once the
macro
(data1) has run it sorts by column J, then highlights J1 and K1 and stops.
The reason it stops is I have to select the contents that are in Col J
that
have a value of 1 or less and then delete those contents of the selected
cells and those cells that are adjacent to the selected values in Col j in
Col K. I then run another macro (data2) that deletes all of Col J, sorts
by
Col L and then highlights Col L1 and Col M1 and stops. The process
continues
until I complete Col R and Col S (data6). Then I run the last macro
(data7)
which does the final manipulation.

I would first like to be able to create a macro that sorts, removes the
contents and the adjacent contents (K) in this instance, then deletes the
first column, (J) in this instance, then sorts the next columns and
repeats
itself until it comes up to another macro at the end that does the final
manipulations ( the first and last macros are constantly changing somewhat
depending on the data uploaded. All in all, I would like to create the
sorting and deleting macros that I do manually now then be able to tie all
of
the macros into one. And, how do you tie the end of one to the beginning
of
another.

This is an snapshot example of the data once it is first manipulated by
(data1) and ready to have the values =<1 along with the adjacent value
deleted in Col J and K. Notice there is a value (2) in J that would not
be
deleted and only requires a clear content at first then a complete
deletion
of Col J. The purpose is to rid the values in K that have a value
attributed
to anything 1 or less in J.

I J K L
M
Distance FirstCall FirstCallLenAdj SecondCall SecondCallLenAdj
1 6.00 .50 0.54 0.50 0.25
2 6.00 1.00 0.35 0.50 0.32
3 6.00 1.00 0.26 1.00 0.45
4 6.00 2.00 0.32 2.00 0.78


This is the end of (data1) as it stops,

Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Cells.Select
Selection.Sort Key1:=Range("J2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("J2:K2").Select

This is macro2 thru macro6 only the names and col# change accordingly

Sub Data2()
'
' Data2 Macro
' Macro recorded 08/07/2006 by User
'
' Keyboard Shortcut: Ctrl+w
'
Columns("J:J").Select
Selection.Delete Shift:=xlToLeft
Cells.Select
Selection.Sort Key1:=Range("K2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("K2:L2").Select
End Sub


This is the beginning of (data7)

Data7 Macro
' Macro recorded 09/06/2006 by User
'
' Keyboard Shortcut: Ctrl+u
'
Range("A1:R1").Select
Selection.Font.ColorIndex = 15
Selection.Font.ColorIndex = 1
Rows("2:2").Select
ActiveWindow.FreezePanes = False



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 130
Default Macro

1. If a cell in J = 1 or less, delete that content and the adjacent content
in K.
2. Then delete col j
3. If a cell in L = 1 or less, delete that content and the adjacent content
in M.
4. Then delete col L.
5. And so on until it reaches the described column in the first note.

6. How do you join macros, end to beginning when you have so many macros as
this. Where does the code stop and you can place another beginning code of
another macro so they run seamlessly.

"Don Guillett" wrote:

Are we to understand that you want to clear the contents of any cell in col
F thru col S and the cell to the right if the cell cell value is <1. If so,
you are going to a lot of trouble.?? Perhaps a re-stating of the entire
problem.?

--
Don Guillett
SalesAid Software

"Shu of AZ" wrote in message
...
I have a data set that is manipulated by a macro (data1) to set certain
columns in order so as to read them into another spreadsheet. Once the
macro
(data1) has run it sorts by column J, then highlights J1 and K1 and stops.
The reason it stops is I have to select the contents that are in Col J
that
have a value of 1 or less and then delete those contents of the selected
cells and those cells that are adjacent to the selected values in Col j in
Col K. I then run another macro (data2) that deletes all of Col J, sorts
by
Col L and then highlights Col L1 and Col M1 and stops. The process
continues
until I complete Col R and Col S (data6). Then I run the last macro
(data7)
which does the final manipulation.

I would first like to be able to create a macro that sorts, removes the
contents and the adjacent contents (K) in this instance, then deletes the
first column, (J) in this instance, then sorts the next columns and
repeats
itself until it comes up to another macro at the end that does the final
manipulations ( the first and last macros are constantly changing somewhat
depending on the data uploaded. All in all, I would like to create the
sorting and deleting macros that I do manually now then be able to tie all
of
the macros into one. And, how do you tie the end of one to the beginning
of
another.

This is an snapshot example of the data once it is first manipulated by
(data1) and ready to have the values =<1 along with the adjacent value
deleted in Col J and K. Notice there is a value (2) in J that would not
be
deleted and only requires a clear content at first then a complete
deletion
of Col J. The purpose is to rid the values in K that have a value
attributed
to anything 1 or less in J.

I J K L
M
Distance FirstCall FirstCallLenAdj SecondCall SecondCallLenAdj
1 6.00 .50 0.54 0.50 0.25
2 6.00 1.00 0.35 0.50 0.32
3 6.00 1.00 0.26 1.00 0.45
4 6.00 2.00 0.32 2.00 0.78


This is the end of (data1) as it stops,

Columns("F:F").Select
Columns("F:F").EntireColumn.AutoFit
Cells.Select
Selection.Sort Key1:=Range("J2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("J2:K2").Select

This is macro2 thru macro6 only the names and col# change accordingly

Sub Data2()
'
' Data2 Macro
' Macro recorded 08/07/2006 by User
'
' Keyboard Shortcut: Ctrl+w
'
Columns("J:J").Select
Selection.Delete Shift:=xlToLeft
Cells.Select
Selection.Sort Key1:=Range("K2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("K2:L2").Select
End Sub


This is the beginning of (data7)

Data7 Macro
' Macro recorded 09/06/2006 by User
'
' Keyboard Shortcut: Ctrl+u
'
Range("A1:R1").Select
Selection.Font.ColorIndex = 15
Selection.Font.ColorIndex = 1
Rows("2:2").Select
ActiveWindow.FreezePanes = False




Reply
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
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


All times are GMT +1. The time now is 07:24 AM.

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

About Us

"It's about Microsoft Excel"