Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default DREAM FEATU A macro that moves a row but asks me where to move it

I would love to have a macro, that when a button is pushed, will move the selected row (or A:AP) and asked me where to move it. I don't know if a pop-up message box with buttons to push or a combo box with selections to click or another way is best, but based on the selections picked would move the row either to a new place on the current sheet or to another sheet. For example:

"Potential" = sheet2 (inserted above row 3)
"Future" = sheet3 (inserted above row 3)
"Ageement Sent" = insert above row 3 on current sheet

When the macro has completed, I would like the previous row not to be left empty but to be deleted.

M I asking too much of Excel?

Thanks in advance,
magmike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default DREAM FEATU A macro that moves a row but asks me where to move it

I would love to have a macro, that when a button is pushed, will move
the selected row (or A:AP) and asked me where to move it. I don't
know if a pop-up message box with buttons to push or a combo box with
selections to click or another way is best, but based on the
selections picked would move the row either to a new place on the
current sheet or to another sheet. For example:

"Potential" = sheet2 (inserted above row 3)
"Future" = sheet3 (inserted above row 3)
"Ageement Sent" = insert above row 3 on current sheet

When the macro has completed, I would like the previous row not to be
left empty but to be deleted.

M I asking too much of Excel?

Thanks in advance,
magmike


Check out Application.InputBox! This will allow users to select a range
in any sheet of any open workbook, simply by setting its 'Type'
property. Your code should grab a ref to the currently selected row,
use 'Cut' and specify the range returned by Application.InputBox as the
destination to 'Insert cut cells'. Presumably, you want the shift
'xlDown'!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default DREAM FEATU A macro that moves a row but asks me where to move it

Can you give me an example of how to use it?

On Wednesday, December 18, 2013 9:53:00 AM UTC-6, magmike wrote:
I would love to have a macro, that when a button is pushed, will move the selected row (or A:AP) and asked me where to move it. I don't know if a pop-up message box with buttons to push or a combo box with selections to click or another way is best, but based on the selections picked would move the row either to a new place on the current sheet or to another sheet. For example: "Potential" = sheet2 (inserted above row 3) "Future" = sheet3 (inserted above row 3) "Ageement Sent" = insert above row 3 on current sheet When the macro has completed, I would like the previous row not to be left empty but to be deleted. M I asking too much of Excel? Thanks in advance, magmike


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default DREAM FEATU A macro that moves a row but asks me where to move it

Can you give me an example of how to use it?

Uh! There's examples in the online help. I expect that you don't need
spoon feeding given the amount of programming you've done over the past
several years. Otherwise, I don't have a generic example made up but
can do if need be and time permits<g...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default DREAM FEATU A macro that moves a row but asks me where to move it

I am not a programmer. I am smart enough to modify code for my own uses and even that is limited. Have no training in code or how to build it from scratch, etc. I have looked at the example and haven't the slightest idea how to implement it. I'm guessing, though, that when I call it with the click of my button a box will come up asking me for coordinates and I'll have to type in something like "sheet2!A3:AP3", correct? Will that overwrite what is there or insert it above the current A3:AP3?

How would I predefine 3 or 4 options, and cause the prompt that comes up to give me a choice of those?

On Wednesday, December 18, 2013 12:14:27 PM UTC-6, GS wrote:
Can you give me an example of how to use it? Uh! There's examples in the online help. I expect that you don't need spoon feeding given the amount of programming you've done over the past several years. Otherwise, I don't have a generic example made up but can do if need be and time permits<g... -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default DREAM FEATU A macro that moves a row but asks me where to move it

I am not a programmer. I am smart enough to modify code for my own
uses and even that is limited. Have no training in code or how to
build it from scratch, etc. I have looked at the example and haven't
the slightest idea how to implement it. I'm guessing, though, that
when I call it with the click of my button a box will come up asking
me for coordinates and I'll have to type in something like
"sheet2!A3:AP3", correct? Will that overwrite what is there or insert
it above the current A3:AP3?

How would I predefine 3 or 4 options, and cause the prompt that comes
up to give me a choice of those?


Ah! In this case a turnkey solution is needed, then. If I correctly
understand your task then...

1. select the row[s] to move
2. click a menu/button to display a dialog that lets you select the
destination row on another sheet in the same workbook OR any open
workbook.
3. When you click OK on the dialog the selected row[s] are moved.

...is what you want the macro to do.

Sub MoveRows()
Dim rngSource As Range, rngTarget As Range
Set rngSource = Selection.EntireRow
Set rngTarget = Application.InputBox(Prompt:="Select the destination
row position", Title:="Move Rows", Type:=8)
rngSource.EntireRow.Cut rngTarget
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default DREAM FEATU A macro that moves a row but asks me where to move it

Slightly improved to handle if you cancel...

Sub MoveRows()
Dim rngSource As Range, rngTarget As Range
Const sPrompt$ = "Select the destination row position"

Set rngSource = Selection.EntireRow
Set rngTarget = Application.InputBox(Prompt:=sPrompt, _
Title:="Move Rows", Type:=8)
If Not rngTarget Is Nothing Then rngSource.Cut rngTarget
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default DREAM FEATU A macro that moves a row but asks me where to move it

On Wednesday, December 18, 2013 10:53:00 AM UTC-5, magmike wrote:
I would love to have a macro, that when a button is pushed, will move the selected row (or A:AP) and asked me where to move it. I don't know if a pop-up message box with buttons to push or a combo box with selections to click or another way is best, but based on the selections picked would move the row either to a new place on the current sheet or to another sheet. For example:



"Potential" = sheet2 (inserted above row 3)

"Future" = sheet3 (inserted above row 3)

"Ageement Sent" = insert above row 3 on current sheet



When the macro has completed, I would like the previous row not to be left empty but to be deleted.



M I asking too much of Excel?



Thanks in advance,

magmike


The List Assistant does exactly what you want:

http://www.add-ins.com/list_assistant.htm
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
References that move down as formula moves across - and vice versa? Michelle Excel Worksheet Functions 3 August 14th 09 11:33 PM
References that move down as formula moves across - and vice versa? Michelle Excel Programming 2 August 14th 09 11:33 PM
Command button moves even with don't move or resize checked. kelee Excel Discussion (Misc queries) 4 October 14th 08 01:11 PM
macro in 2003 template asks for non-existent XLS Dave D[_3_] Excel Programming 4 June 13th 04 05:38 PM
Macro that asks for password Jonsson Excel Programming 0 October 8th 03 12:11 PM


All times are GMT +1. The time now is 02:00 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"