Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 Macro to Insert line 1

Status
Not open for further replies.

rose12346

Technical User
Mar 12, 2014
6
US
I have on worksheet1 which has the following columns:
A. Store
B. Ship Via
C. Carton
D. SKU
E. Qty
Sample Data
A B C D E[
06001 FDX 7132 123456 2
06001 FDX 7132 786115 3
06010 FDX 8033 123456 1
06011 INT 7943 661723 5
This is what I would like to do on Worksheet 2:
For the first row or record on Worksheet1 have a macor or formula that would write the following in Worksheet2:
Sess0.Screen.Sendkeys("Worksheet1!A1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("Worksheet1!B1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("Worksheet1D1<Tab>Worksheet1E1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
If the second record in worksheet1 has a value in C2 that is equal to C1 I want to write the following in Worksheet2 on the line preceeding what was written above for the first record:
Sess0.Screen.Sendkeys("Worksheet1D2<Tab>Worksheet1E2<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
If the next record in worksheet1 C3 does not equal the value in C2 then I want to write the following in Worksheet2 on the line preceeding written above if it does equal then I want to write the same information as record 2 above:
Sess0.Screen.Sendkeys("<Pf16>")
I then want to go back to the record which did not match C2 and write the following on Worksheet2:
Sess0.Screen.Sendkeys("Worksheet1!C3<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("Worksheet1!B3<Enter>") 3
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("Worksheet1D3<Tab>Worksheet1E3<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Is this possible in Excel and I am not at all experienced with macros but I am more than willing to learn.

I might be in over my head but I am willing to attempt learning if this is at all possible within Excel 2007

Thank you
Rose12346

 
Hard
To
Read

I suggest using Code tags, and then also do what you can to space out the sample data. Formatting goes a long way for folks to easily read your request and help.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
If you click the small question mark icon (help) to the left of the Preview button where you add a new post, you'll see more info on how to do this using TGML. Now, however, you don't have to know the bracketed terms for TGML, but just use the buttons on the toolbar above your posted text. Hover over any button, and it'll tell you what it does.

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
[sad]This is not the current thread I am uncertain on how to remove or close the thread but I submitted a new thread with the proper formatting.

Sorry
Rose12346
 
If you want to, you can click on "Red Flag This Post", type a little explanation and people at TT will remove it for you.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top