Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Neal Zimm
 
Posts: n/a
Default Relative Macro Help on Keystrokes

I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

Try recording a macro when you select the range, and do data|Text to columns.

You can specify that the column is delimited by space.

If you have trouble generalizing your code, post back with what you have.

Neal Zimm wrote:

I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z


--

Dave Peterson
  #3   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Neal,

Excel's macro language is not a keystroke language. The macro recorder will
record whatever data you leave the cell with -- it doesn't care how you did
it.

For your situation, if you want it split in half, you could put a formula in
col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do Paste
Special - Values (right over them). now you don't need the original stuff
in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is always
a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z



  #4   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z





  #5   Report Post  
Neal Zimm
 
Posts: n/a
Default

thanks. give me a day or two to try this out.
Neal


"Earl Kiosterud" wrote:

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z








  #6   Report Post  
Neal Zimm
 
Posts: n/a
Default

Oh yes, one more thing, the original cell contents from left to right a
a 4 digit number,
a blank,
an alphanumeric character string varying from all blanks to a string of 20
characters.


"Earl Kiosterud" wrote:

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z






  #7   Report Post  
Neal Zimm
 
Posts: n/a
Default

Thanks. give me a day or two to try it out.
Neal


"Dave Peterson" wrote:

Try recording a macro when you select the range, and do data|Text to columns.

You can specify that the column is delimited by space.

If you have trouble generalizing your code, post back with what you have.

Neal Zimm wrote:

I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z


--

Dave Peterson

  #8   Report Post  
Dave Peterson
 
Posts: n/a
Default

If it's always that format and you can use a couple of formulas:

=left(a1,4)
(4 leftmost characters)

=mid(a1,6,255)
(starts at character #6 and goes far enough to the right to get past your 20
character limit.)

Neal Zimm wrote:

Oh yes, one more thing, the original cell contents from left to right a
a 4 digit number,
a blank,
an alphanumeric character string varying from all blanks to a string of 20
characters.

"Earl Kiosterud" wrote:

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z






--

Dave Peterson
  #9   Report Post  
Neal Zimm
 
Posts: n/a
Default

functions worked nicely. thanks.
Neal


"Dave Peterson" wrote:

If it's always that format and you can use a couple of formulas:

=left(a1,4)
(4 leftmost characters)

=mid(a1,6,255)
(starts at character #6 and goes far enough to the right to get past your 20
character limit.)

Neal Zimm wrote:

Oh yes, one more thing, the original cell contents from left to right a
a 4 digit number,
a blank,
an alphanumeric character string varying from all blanks to a string of 20
characters.

"Earl Kiosterud" wrote:

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z






--

Dave Peterson

  #10   Report Post  
Neal Zimm
 
Posts: n/a
Default

Functions worked nicely, thanks so much.
Neal

"Earl Kiosterud" wrote:

Neal,

I just noticed that there's a space between aaaa and bbbb. I'll submit the
following formulas instead:

=LEFT(A2, SEARCH(" ", A2)-1)
=RIGHT(A2, LEN(A2)-SEARCH(" ",A2))

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Earl Kiosterud" wrote in message
...
Neal,

Excel's macro language is not a keystroke language. The macro recorder
will record whatever data you leave the cell with -- it doesn't care how
you did it.

For your situation, if you want it split in half, you could put a formula
in col's B anc C:
=LEFT(A2, 4) =RIGHT(A2, 4)

To convert the formulas to actual data, copy columns B and C, then do
Paste Special - Values (right over them). now you don't need the original
stuff in Column A any more.

If you splilt the data on something other than 4 characters, tell us what
the criteria is, and we'll go from there.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Neal Zimm" wrote in message
...
I need a work around to the following situation.
I'm editing a lot of cells to split the data into two cells and there is
a
pattern, but Excel is picking up 'keystrokes' I don't want. aaaa is
always a
4 digit number, and bbbb is various text.
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb

I recorded a relative macro, and I get the desired result the first time,
BUT, not the second.
Example:
Befo
cell 1 cell 2
aaaa bbbb

Desired After:
cell 1 cell 2
aaaa bbbb this one works.

next set of two cells, befo
cell 1 cell 2
cccc dddd

After Actual when macro is run:
cell 1 cell 2
aaaa bbbb

even tho' the macro is relative, Excel is obviously remembering the
value's
aaaa and bbbb on subsequent cells; this I do NOT want.

Help? Thanks.
--
Neal Z






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
excel macro inconsistency JM Excel Discussion (Misc queries) 2 December 9th 04 01:13 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM
Macro help Jeff Garrett Excel Discussion (Misc queries) 11 December 1st 04 08:47 PM
macro - adding rows to a column that is summed HGood Excel Discussion (Misc queries) 2 December 1st 04 03:28 PM
macro interruption: help!!! mario milani Excel Discussion (Misc queries) 1 November 30th 04 06:02 PM


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