Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel Macro Code Help

I'm trying to write a macro to select a cell, move to the end of the cell,
press enter, and move to the next cell in that row & then repeat for all rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Excel Macro Code Help

You could also use ActiveCell.Offset(1,0).Select in place of each of the
Range("99").Select commands.


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the cell,
press enter, and move to the next cell in that row & then repeat for all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Macro Code Help

Your write up is somewhat confusing to me. You say "move to the end of the
cell", but I am not sure what you mean by that. You also say "and move to
the next cell in that **row**" (emphasis on the word "row" is mine);
however, your code shows no movement from column to column within the same
row, only movement from row to row. And where did the numbers come from? Are
there more of them? Perhaps if you try describing what you want to do in
more detail, it might help?

Rick


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the cell,
press enter, and move to the next cell in that row & then repeat for all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel Macro Code Help

Thanks, but how do I get it to repeat through each row that has a value in
the column?

"Castell" wrote:

You could also use ActiveCell.Offset(1,0).Select in place of each of the
Range("99").Select commands.


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the cell,
press enter, and move to the next cell in that row & then repeat for all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Excel Macro Code Help

More info please?


"Jeanne A" wrote in message
...
Thanks, but how do I get it to repeat through each row that has a value in
the column?

"Castell" wrote:

You could also use ActiveCell.Offset(1,0).Select in place of each of the
Range("99").Select commands.


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the
cell,
press enter, and move to the next cell in that row & then repeat for
all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel Macro Code Help

Here's a sample of the spreadsheet.

ITEM NBR MFG CODE MFG DIV MFG NBR
108913 STRY STMD 0026-261-000
108914 STRY STMD 0715-001-265
108915 STRY STMD 0715-001-266
108916 STRY STMD 1010-700-035
108917 STRY STMD 1010-700-055
108918 STRY STMD 1010-700-075

I need to go to the end of the first item number in row 2, press the enter
key, and repeat for all remaining item numbers in that column on the
spreadsheet. The number of rows in the column will change each time I run
the query in Access and import into Excel.

I hope this helps! Thanks.

"Rick Rothstein (MVP - VB)" wrote:

Your write up is somewhat confusing to me. You say "move to the end of the
cell", but I am not sure what you mean by that. You also say "and move to
the next cell in that **row**" (emphasis on the word "row" is mine);
however, your code shows no movement from column to column within the same
row, only movement from row to row. And where did the numbers come from? Are
there more of them? Perhaps if you try describing what you want to do in
more detail, it might help?

Rick


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the cell,
press enter, and move to the next cell in that row & then repeat for all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Macro Code Help

I'm afraid that is still not enough detail (at least for me it isn't). What
are you trying to accomplish in the end? You say you want to go to the end
of the first item in Row 2... does that mean you want to enter Edit mode and
have the text cursor located at after the "3" in the number "108913"? Then
you say you want to press the Enter key. Why? What is doing that supposed to
accomplish (besides moving the active cell down one row)? You have described
actions you want to perform, but not told us what is supposed to happen as a
result. For example, are you wanting to delete the entry, copy it to another
location, something else? The thing you need to do when posing a question on
a newsgroup is re-read what you have written and ask yourself, "If the
person who reads this know absolutely NOTHING about what I am trying to do,
can he/she figure it out from what I have written?" The reason you have to
do this is because no one here will know anything about what you are trying
to do unless you tell them. Don't assume we can piece it together or figure
it out... tell us... in detail.

Rick


"Jeanne A" wrote in message
...
Here's a sample of the spreadsheet.

ITEM NBR MFG CODE MFG DIV MFG NBR
108913 STRY STMD 0026-261-000
108914 STRY STMD 0715-001-265
108915 STRY STMD 0715-001-266
108916 STRY STMD 1010-700-035
108917 STRY STMD 1010-700-055
108918 STRY STMD 1010-700-075

I need to go to the end of the first item number in row 2, press the enter
key, and repeat for all remaining item numbers in that column on the
spreadsheet. The number of rows in the column will change each time I run
the query in Access and import into Excel.

I hope this helps! Thanks.

"Rick Rothstein (MVP - VB)" wrote:

Your write up is somewhat confusing to me. You say "move to the end of
the
cell", but I am not sure what you mean by that. You also say "and move to
the next cell in that **row**" (emphasis on the word "row" is mine);
however, your code shows no movement from column to column within the
same
row, only movement from row to row. And where did the numbers come from?
Are
there more of them? Perhaps if you try describing what you want to do in
more detail, it might help?

Rick


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the
cell,
press enter, and move to the next cell in that row & then repeat for
all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Excel Macro Code Help

Why to you press ENTER? What does that achieve?


"Jeanne A" wrote in message
...
Here's a sample of the spreadsheet.

ITEM NBR MFG CODE MFG DIV MFG NBR
108913 STRY STMD 0026-261-000
108914 STRY STMD 0715-001-265
108915 STRY STMD 0715-001-266
108916 STRY STMD 1010-700-035
108917 STRY STMD 1010-700-055
108918 STRY STMD 1010-700-075

I need to go to the end of the first item number in row 2, press the enter
key, and repeat for all remaining item numbers in that column on the
spreadsheet. The number of rows in the column will change each time I run
the query in Access and import into Excel.

I hope this helps! Thanks.

"Rick Rothstein (MVP - VB)" wrote:

Your write up is somewhat confusing to me. You say "move to the end of
the
cell", but I am not sure what you mean by that. You also say "and move to
the next cell in that **row**" (emphasis on the word "row" is mine);
however, your code shows no movement from column to column within the
same
row, only movement from row to row. And where did the numbers come from?
Are
there more of them? Perhaps if you try describing what you want to do in
more detail, it might help?

Rick


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the
cell,
press enter, and move to the next cell in that row & then repeat for
all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel Macro Code Help

Sorry...I'm new to using macros and this website. For whatever reason when I
do a Vlookup on the item number field (A2) or the manuf. part number field
(D2) it doesn't recognize it until I go into the cell and press the enter
enter key....bizzare....I know. This spreadsheet is a result of an Access
query that is pulling data from a linked table in Lawson (our Supply
Chain/Procurement/HR/Finance system). The Vlookup is used to match the
manufacturer part number from our data (the excel spreadsheet pulled from
Access) to the manufacturer part number on a vendor/manufacturer's
spreadsheet to link the item with it's pricing. We then upload the pricing
back into Lawson with MS-Addins. Hope this helps explain things.

"Castell" wrote:

Why to you press ENTER? What does that achieve?


"Jeanne A" wrote in message
...
Here's a sample of the spreadsheet.

ITEM NBR MFG CODE MFG DIV MFG NBR
108913 STRY STMD 0026-261-000
108914 STRY STMD 0715-001-265
108915 STRY STMD 0715-001-266
108916 STRY STMD 1010-700-035
108917 STRY STMD 1010-700-055
108918 STRY STMD 1010-700-075

I need to go to the end of the first item number in row 2, press the enter
key, and repeat for all remaining item numbers in that column on the
spreadsheet. The number of rows in the column will change each time I run
the query in Access and import into Excel.

I hope this helps! Thanks.

"Rick Rothstein (MVP - VB)" wrote:

Your write up is somewhat confusing to me. You say "move to the end of
the
cell", but I am not sure what you mean by that. You also say "and move to
the next cell in that **row**" (emphasis on the word "row" is mine);
however, your code shows no movement from column to column within the
same
row, only movement from row to row. And where did the numbers come from?
Are
there more of them? Perhaps if you try describing what you want to do in
more detail, it might help?

Rick


"Jeanne A" wrote in message
...
I'm trying to write a macro to select a cell, move to the end of the
cell,
press enter, and move to the next cell in that row & then repeat for
all
rows
in that column. Here's what I have so far.

Range("A2").Select
ActiveCell.FormulaR1C1 = "07-30365"
Range("A3").Select
ActiveCell.FormulaR1C1 = "07-40281"
Range("A4").Select
ActiveCell.FormulaR1C1 = "1272-00-02"
Range("A5").Select
ActiveCell.FormulaR1C1 = "1272-00-03"
Range("A6").Select
ActiveCell.FormulaR1C1 = "1272-00-04"
Range("A7").Select
ActiveCell.FormulaR1C1 = "1272-00-05"
Range("A8").Select
End Sub



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Excel Macro Code Help

My guess will be there'll be an easier way to update the cells, try to
save or refresh data.

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
Can I use code/macro to change code/macro in an existing file? Scott Bedows Excel Programming 2 February 14th 07 05:50 AM
do anybody have a sample code for executing excel macro from vb code?<eom B Deepak Excel Programming 2 September 30th 05 09:59 AM
Need help with code for Excel Macro mercedes[_2_] Excel Programming 2 July 7th 05 04:32 AM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Ed[_18_] Excel Programming 4 May 20th 04 02:08 PM
Excel XP VBA code to search all macro code in Excel module for specific search string criteria Frank Kabel Excel Programming 0 May 19th 04 08:11 PM


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