Home |
Search |
Today's Posts |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
You can probably have a much simpler looping macro. Why not give us much
more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Will try. column 'M & N' are on sheet data. Going to sheet desc 'A2' I
enlarge a cell to accept 234 charcaters. This cell I wish to copy back to column 'M' on data. The columns 'M&N' may be 150 long. Am trying to figure how to use active cell reference from desc A2 to column 'M' on data. Each cell in data col 'M' will have different text entry when entered. The code I built will do the job if I rewrite it for every cell in column and chg reference addresses. If a active cell reference can be established then all I have to do is call the procedurs from a cell in column 'N' in data to go to 'A2' desc. Description Enter Data 'M' 'N' Has buttons from forms bar with macro assignment Then have text in 'A2' on desc returned to Active cell offset 1 on data can column 'N' be reference as active cell with form controls over cell? Hope this is understandable Hope I didn't mud it to much Thanks Thanks "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Hope you get this one first. Got away from screen and helped with reply.
Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Send your workbook, with code and details of what you want and I will have a
look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
when I try to copy it will not let me paste? Don't know why.This is code for
copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
If you INSIST on doing it this way, you need to specify the cell. There is
no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
It is not my idea to not send workbook. I can not get it to paste into reply.
Is there a way to go from wksheet desc to wksheet data to get to the cell it was called from as an active cell for pasteing offset. I am trying to not have to have a procedure for each cell. I can do it by defining each cell in column. Is ther a way to use this to get a2 from wks to another wks Guess I am after something that doesn't exist. Thanks so much You are appreciated 'ActiveCell.Offset(0, -1).Value = "data" does this only work one way "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
to send a file to me
reply to me or compose a new message using my emailinsertfile attachmentetc -- Don Guillett SalesAid Software "Curt" wrote in message ... It is not my idea to not send workbook. I can not get it to paste into reply. Is there a way to go from wksheet desc to wksheet data to get to the cell it was called from as an active cell for pasteing offset. I am trying to not have to have a procedure for each cell. I can do it by defining each cell in column. Is ther a way to use this to get a2 from wks to another wks Guess I am after something that doesn't exist. Thanks so much You are appreciated 'ActiveCell.Offset(0, -1).Value = "data" does this only work one way "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Post your final solution for the benefit of all.
-- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
To get from one sheet to the other must be in cell where data is to go but
this is what worked for me. It can be copied for the whole column Thanks to all Option Explicit Sub active_offset() Dim data As Worksheet Range("a2").Select Selection.Cut Sheets("Data").Select ActiveSheet.Paste End Sub "Don Guillett" wrote: Post your final solution for the benefit of all. -- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
As long as you are happy with doing it this way we will not try to confuse
you further. -- Don Guillett SalesAid Software "Curt" wrote in message ... To get from one sheet to the other must be in cell where data is to go but this is what worked for me. It can be copied for the whole column Thanks to all Option Explicit Sub active_offset() Dim data As Worksheet Range("a2").Select Selection.Cut Sheets("Data").Select ActiveSheet.Paste End Sub "Don Guillett" wrote: Post your final solution for the benefit of all. -- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Learning is all ways confuseing.
Thanks for all your assistance "Don Guillett" wrote: As long as you are happy with doing it this way we will not try to confuse you further. -- Don Guillett SalesAid Software "Curt" wrote in message ... To get from one sheet to the other must be in cell where data is to go but this is what worked for me. It can be copied for the whole column Thanks to all Option Explicit Sub active_offset() Dim data As Worksheet Range("a2").Select Selection.Cut Sheets("Data").Select ActiveSheet.Paste End Sub "Don Guillett" wrote: Post your final solution for the benefit of all. -- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
It is less confusing when you endeavor to learn to do it more efficiently
and properly. I suspect you are doing a LOT more than is necessary or desirable. -- Don Guillett SalesAid Software "Curt" wrote in message ... Learning is all ways confuseing. Thanks for all your assistance "Don Guillett" wrote: As long as you are happy with doing it this way we will not try to confuse you further. -- Don Guillett SalesAid Software "Curt" wrote in message ... To get from one sheet to the other must be in cell where data is to go but this is what worked for me. It can be copied for the whole column Thanks to all Option Explicit Sub active_offset() Dim data As Worksheet Range("a2").Select Selection.Cut Sheets("Data").Select ActiveSheet.Paste End Sub "Don Guillett" wrote: Post your final solution for the benefit of all. -- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
#15
Posted to microsoft.public.excel.programming
|
|||
|
|||
active offset
Ran up against a sort problem. Have code that will sort numerically but will
not move rows when it sorts on column. Not sure how to get rows into this code. Useing column D for sort have a pull down in this column. This could be changed to A if needed. Will paste the code that sorts. Hope having rows to column M go with sort moveent. Any Ideas? Thanks Dim cell As Range Dim rng As Range Dim rng1 As Range For Each cell In Range("D16") Set rng = Range(cell, cell.End(xlDown)) cell.Offset(0, 1).EntireColumn.Insert Set rng1 = cell.Offset(0, 1).Resize(rng.Count, 1) rng1.Formula = "=Countif(" & rng(1).Address(1, 1) & _ ":" & rng(1).Address(0, 0) & "," & _ rng(1).Address(0, 0) & ")" rng1.Formula = rng1.Value Range(cell, cell.Offset(0, 1)).Resize(rng.Count).Sort _ key1:=cell.Offset(0, 1), Order1:=xlAscending, _ key2:=cell, Order2:=xlAscending cell.Offset(0, 1).EntireColumn.Delete Next "Don Guillett" wrote: It is less confusing when you endeavor to learn to do it more efficiently and properly. I suspect you are doing a LOT more than is necessary or desirable. -- Don Guillett SalesAid Software "Curt" wrote in message ... Learning is all ways confuseing. Thanks for all your assistance "Don Guillett" wrote: As long as you are happy with doing it this way we will not try to confuse you further. -- Don Guillett SalesAid Software "Curt" wrote in message ... To get from one sheet to the other must be in cell where data is to go but this is what worked for me. It can be copied for the whole column Thanks to all Option Explicit Sub active_offset() Dim data As Worksheet Range("a2").Select Selection.Cut Sheets("Data").Select ActiveSheet.Paste End Sub "Don Guillett" wrote: Post your final solution for the benefit of all. -- Don Guillett SalesAid Software "Curt" wrote in message ... Just to let you know. This old dog finnaly got it to work. Thanks again for the support you and others give. My Appreciation "Don Guillett" wrote: If you INSIST on doing it this way, you need to specify the cell. There is no such thing as range("activecell") Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("a1").offset( etc End Sub -- Don Guillett SalesAid Software "Curt" wrote in message ... when I try to copy it will not let me paste? Don't know why.This is code for copy not right. Sub active_offset() Range("a2").Select Selection.Cut ------------------------trouble from here Sheets("data").Select Range("active cell").Select ActiveCell.Offset(0, -1).Value = "desc,a2" ActiveSheet.Paste I am in wksheet desc want to cut then paste to active cell offset wksheet data active cell Thanks for your effort I greatly appreciate it "Don Guillett" wrote: Send your workbook, with code and details of what you want and I will have a look. -- Don Guillett SalesAid Software "Curt" wrote in message ... Hope you get this one first. Got away from screen and helped with reply. Ihave a macro in column 'N?' in data wksheet. This macro calls a procedure that formats and sets up desc wksheet cell A2. text is then entered. Now need to be able to cut & paste 'A2' to Active cell 'N?' offset to column 'Mcell?' Useing an active cell ref all I have to do for each cell is call procedure. Thanks for Your Patiance. "Don Guillett" wrote: You can probably have a much simpler looping macro. Why not give us much more info. -- Don Guillett SalesAid Software "Curt" wrote in message ... I am trying to use the active cell offset so as not to have to have a procedure for each cell. This operation must be done repeated times. Trying to figure how to write one procedure that can reference where called from so as to call it the active cell to offset from. This way all I need to do is call this procedure from the cells in repeated moves.May be up to 150 times to enter data to use this method. If I can keep from having to use addresses in each call that is what I am after I think. It is hard to explain and for another to grasp. I will toy with what you sent and see what I can do Thanks "Don Guillett" wrote: It's not clear to me what you are trying to do but this will MOVE a cell to another worksheet withOUT any selections of any kind. This is a ONE liner that I split using the continuation _ to prevent word wrap. Sub cutpaste() Sheets("sheet10").Range("d16").Cut _ Destination:=Sheets("sheet9").Range("G1") End Sub without the split Sheets("sheet10").Range("d16").Cut Destination:=Sheets("sheet9").Range("G1") -- Don Guillett SalesAid Software "Curt" wrote in message ... never used this. Am trying to call sub desc_1 with a macro in m16 of" data". This takes me to a diff wksheet "desc". I then input data. Want ot cut and paste the cell back to L16 of"data" i called from. This would be offset 1. following is the subs I am trying to work with. Can I declare m16 of sheet the active cell? Old Dog New Tricks Thanks Sub Desc_1() ' ' Desc_1 Macro ' Macro recorded 1/11/2007 by Default ' Range("N16").Select Sheets("Desc").Select Range("A2").Select Rows("2:2").RowHeight = 78 Columns("A:A").ColumnWidth = 39 Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlGeneral .VerticalAlignment = xlTop .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = False .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub Sub Desc_1A() ' ' Desc_2 Macro ' Macro recorded 1/11/2007 by Default ' Range("A2").Select Selection.Cut Sheets("Data").Select Range("M16").Select ActiveSheet.Paste Selection.NumberFormat = "@" With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .ShrinkToFit = True .MergeCells = False End With Selection.Locked = True Selection.FormulaHidden = False End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
move from active cell offset in macro | Excel Discussion (Misc queries) | |||
Compare Cell Values, Offset(-1,0), Offset(-1,-1), and xlFillDefaul | Excel Worksheet Functions | |||
Find, Copy offset to offset on other sheet, Run-time 1004. | Excel Programming | |||
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. | Excel Discussion (Misc queries) |