ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro To Move Cell Over (https://www.excelbanter.com/excel-programming/349657-macro-move-cell-over.html)

brazen234

Macro To Move Cell Over
 

I have a long list of words in column A. I have to go thru them manuall
and put them into two catagories. Column B will be one category, colum
C the second.
I have been moving the cell contents manually but I wised up and I'
sure there is a macro.

I will be using the down arrow key to move my way down the list and a
I come across the words I would like to press a macro button (which
will create) to move the content into either column B or C.

I tried to record a macro moving the cell contents but it just move
them into the cell that was recorded. I need to move the cell directl
over in the same row.

Thanks again

--
brazen23
-----------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...nfo&userid=995
View this thread: http://www.excelforum.com/showthread.php?threadid=49851


Bob Phillips[_6_]

Macro To Move Cell Over
 
Maybe something as simple as

Function MoveIt()
With Activecell
.Offset(0,1).Value = .Value
.Value = ""
End With
End Function

--

HTH

RP

(remove nothere from the email address if mailing direct)


"brazen234" wrote
in message ...

I have a long list of words in column A. I have to go thru them manually
and put them into two catagories. Column B will be one category, column
C the second.
I have been moving the cell contents manually but I wised up and I'm
sure there is a macro.

I will be using the down arrow key to move my way down the list and as
I come across the words I would like to press a macro button (which I
will create) to move the content into either column B or C.

I tried to record a macro moving the cell contents but it just moves
them into the cell that was recorded. I need to move the cell directly
over in the same row.

Thanks again!


--
brazen234
------------------------------------------------------------------------
brazen234's Profile:

http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514




Jim Thomlinson[_5_]

Macro To Move Cell Over
 
What is the logic to know whether the cell should be moved to Column B or C?
--
HTH...

Jim Thomlinson


"brazen234" wrote:


I have a long list of words in column A. I have to go thru them manually
and put them into two catagories. Column B will be one category, column
C the second.
I have been moving the cell contents manually but I wised up and I'm
sure there is a macro.

I will be using the down arrow key to move my way down the list and as
I come across the words I would like to press a macro button (which I
will create) to move the content into either column B or C.

I tried to record a macro moving the cell contents but it just moves
them into the cell that was recorded. I need to move the cell directly
over in the same row.

Thanks again!


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514



brazen234[_2_]

Macro To Move Cell Over
 

Bob-
I'm not sure how I would go about using that function. And how would it
differentiate between column B or C ?

Jim-
Basically nouns vs adjectives. Most of it is product nouns (guitars,
houses, furniture, etc..).


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514


Jim Thomlinson[_5_]

Macro To Move Cell Over
 
Do you have a list of the Nouns and one of the Adjectives. If so This will be
not too bad to automate... Otherwise it could be a bit tricky...
--
HTH...

Jim Thomlinson


"brazen234" wrote:


I have a long list of words in column A. I have to go thru them manually
and put them into two catagories. Column B will be one category, column
C the second.
I have been moving the cell contents manually but I wised up and I'm
sure there is a macro.

I will be using the down arrow key to move my way down the list and as
I come across the words I would like to press a macro button (which I
will create) to move the content into either column B or C.

I tried to record a macro moving the cell contents but it just moves
them into the cell that was recorded. I need to move the cell directly
over in the same row.

Thanks again!


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514



Bob Phillips[_6_]

Macro To Move Cell Over
 
It wouldn't. As you gave no idea how to differentiate, I couldn't even begin
to guess. What I gave you is a macro that you can incorporate in your
wrapper code.

Or you could make it a sub, and just go down, select the first item to move,
and run it. Then got to the next one, and F4. This includes going to column
B if you want to shift it one more.

Not ideal, but a darn sight faster than manually moving it, and you can get
quite slick at it after a while. But give us the criteria for moving to B or
C and we will totally automate it.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"brazen234" wrote
in message ...

Bob-
I'm not sure how I would go about using that function. And how would it
differentiate between column B or C ?

Jim-
Basically nouns vs adjectives. Most of it is product nouns (guitars,
houses, furniture, etc..).


--
brazen234
------------------------------------------------------------------------
brazen234's Profile:

http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514




alan_stew

Macro To Move Cell Over
 
Brazen,
How about this?
Save this function in your personal.xls, create a button to trigger it
( like you said in your first post)
and you've got it!

Function MoveIt()
intAnswer = InputBox("Move over how many cells, 1 or 2?")
With ActiveCell
.Offset(0, intAnswer).Value = .Value
.Value = ""
End With
End Function

Of course, by now, you could have done the whole list by hand!!! ; )
Alan


brazen234[_3_]

Macro To Move Cell Over
 

Bob-
Just to clarify, my brain will be doing the differentiating. Didn't
mean to make it sound like I wanted the macro/function to do it. So
there is no criteria besides really me deciding what word I want in
column B or C. I don't know what a wrapper code is but I can look it
up. Thank you for your help.

Jim-
There are no seperate lists of the words. I'm creating a list of
premium nouns (like products and services) for a domain registration
project. So I do need to actually go thru each word anyhow.

alan-
Thanks for your contribution. I'm not as familiar with functions as
macros but I will try and to do what you suggest. The list is several
thousand words so maybe I'd be done in a month by hand ! :)


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514


brazen234[_4_]

Macro To Move Cell Over
 

I'm still lost ! How do I use those functions ? I've pasted them into
the VBE and now what ?
Anyhow I wanted to maybe clarify what I want done.

In simplest from I want to create a macro that will:

Move a cell one cell to the right
OR
Move a cell two cells to the right


Maybe that explanation helps more ?


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514


Desert Piranha[_26_]

Macro To Move Cell Over
 

brazen234 Wrote:
I'm still lost ! How do I use those functions ? I've pasted them int
the VBE and now what ?
Anyhow I wanted to maybe clarify what I want done.

In simplest from I want to create a macro that will:

Move a cell one cell to the right
OR
Move a cell two cells to the right

Maybe that explanation helps more ?Hi brazen,

Adding to Alen's excelent post, you can use it
this way to move one or more cells at a time.
Just first select the cells you want to move.
---------------
Sub MoveIt()
Dim intAnswer
intAnswer = InputBox("Move over how many cells, 1 or 2?")
With Selection
.Offset(0, intAnswer).Value = .Value
.Value = ""
End With
End Su

--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=49851


alan_stew

Macro To Move Cell Over
 
brazen,
You know how to get a custom button to run the macro, right? You need
to assign the macro to the button. You should use the version that
Piranha posted since a "Sub" will be visible in the Assign Macro box
and a "Function" won't....sorry I forgot about that.
Alan


Bob Phillips[_6_]

Macro To Move Cell Over
 
Without criteria, there is no point in wrapper code.

Go to the VBIDE (Alt-F11)
Insert a module (InsertModule)
Copy this code into the module

SubMoveIt()
With Activecell
.Offset(0,1).Value = .Value
.Value = ""
End With
End Function

Close the VBIDE and go back to Excl
Select the fisrt cell to be moved
Go To ToolsMacroMacros...
Select MoveIt from the list and Run
Then move to the next cell to move and hit the F4 key
Repeat as required

Not that the next cell could be the one it was just moved to if you want to
move it further

--

HTH

RP
(remove nothere from the email address if mailing direct)


"brazen234" wrote
in message ...

Bob-
Just to clarify, my brain will be doing the differentiating. Didn't
mean to make it sound like I wanted the macro/function to do it. So
there is no criteria besides really me deciding what word I want in
column B or C. I don't know what a wrapper code is but I can look it
up. Thank you for your help.

Jim-
There are no seperate lists of the words. I'm creating a list of
premium nouns (like products and services) for a domain registration
project. So I do need to actually go thru each word anyhow.

alan-
Thanks for your contribution. I'm not as familiar with functions as
macros but I will try and to do what you suggest. The list is several
thousand words so maybe I'd be done in a month by hand ! :)


--
brazen234
------------------------------------------------------------------------
brazen234's Profile:

http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514




brazen234[_5_]

Macro To Move Cell Over
 

Bob Phillips Wrote:
Without criteria, there is no point in wrapper code.

Go to the VBIDE (Alt-F11)
Insert a module (InsertModule)
Copy this code into the module

SubMoveIt()
With Activecell
.Offset(0,1).Value = .Value
.Value = ""
End With
End Function

Close the VBIDE and go back to Excl
Select the fisrt cell to be moved
Go To ToolsMacroMacros...
Select MoveIt from the list and Run
Then move to the next cell to move and hit the F4 key
Repeat as required

Not that the next cell could be the one it was just moved to if you
want to
move it further



Excellent! Works like a dream! Thank you for walking me thru that. You
know what I think happened, your first post had "Function MoveIt()"
instead of "Sub MoveIt()". I could not make it appear in the macros
(what I'm much more used to) and I could not get it to work as a
function.


--
brazen234
------------------------------------------------------------------------
brazen234's Profile: http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514


Bob Phillips[_6_]

Macro To Move Cell Over
 
As I said

.... What I gave you is a macro that you can incorporate in your
wrapper code.

Or you could make it a sub, and just go ....

--

HTH

RP
(remove nothere from the email address if mailing direct)


"brazen234" wrote
in message ...

Bob Phillips Wrote:
Without criteria, there is no point in wrapper code.

Go to the VBIDE (Alt-F11)
Insert a module (InsertModule)
Copy this code into the module

SubMoveIt()
With Activecell
.Offset(0,1).Value = .Value
.Value = ""
End With
End Function

Close the VBIDE and go back to Excl
Select the fisrt cell to be moved
Go To ToolsMacroMacros...
Select MoveIt from the list and Run
Then move to the next cell to move and hit the F4 key
Repeat as required

Not that the next cell could be the one it was just moved to if you
want to
move it further



Excellent! Works like a dream! Thank you for walking me thru that. You
know what I think happened, your first post had "Function MoveIt()"
instead of "Sub MoveIt()". I could not make it appear in the macros
(what I'm much more used to) and I could not get it to work as a
function.


--
brazen234
------------------------------------------------------------------------
brazen234's Profile:

http://www.excelforum.com/member.php...fo&userid=9952
View this thread: http://www.excelforum.com/showthread...hreadid=498514





All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com