Good Morning,
I inherited this Send Key Code that on Column A contains the name, Column B is the amount & it updates the application amount, Column D works with the macro to copy the name from the application into the sheet and use Column E to identify if whether the name in Column A = Column D. I added Column F to take the name in Column A and add _Law at the end. This part was easy, what I am having issues with is now taking what I have put in Column F and using it to update the application for name. Below is my code ...
I inherited this Send Key Code that on Column A contains the name, Column B is the amount & it updates the application amount, Column D works with the macro to copy the name from the application into the sheet and use Column E to identify if whether the name in Column A = Column D. I added Column F to take the name in Column A and add _Law at the end. This part was easy, what I am having issues with is now taking what I have put in Column F and using it to update the application for name. Below is my code ...
Code:
Sub CompleteSTARandExcelSendKeyCode()
'
' CompleteSTARandExcelSendKeyCode Macro
' Macro recorded 12/22/2010 by UMMS User
'
'
Dim EnterKey As String
Dim ThreeKey As String
Dim YesKey As String
Dim AccountKey As String
Dim rowkey As Integer
'-------------------
'AccountKey = "1620001739"
EnterKey = "~"
ThreeKey = "3"
YesKey = "Y"
rowkey = 1
Do
AppActivate ("Microsoft Excel - SendKey_UMMC.xls"), False
Application.Sheets("Accounts").Select
Range("A" & rowkey).Select
AccountKey = Range("A" & rowkey)
'================================================
'STAR Send Key Code
'================================================
'=============================================
'Select UMMC at the Facility Screen
'=============================================
AppActivate ("1 - HBOC_CLN"), False
Application.SendKeys (ThreeKey), True
Application.SendKeys (EnterKey), True
'Enter the account number
Application.Wait (Now + TimeValue("00:00:03"))
AppActivate ("1 - HBOC_CLN"), False
Application.SendKeys (AccountKey), True
Application.SendKeys (EnterKey), True
'Say Yes to Do you wnat to send charges for this account
Application.Wait (Now + TimeValue("00:00:03"))
AppActivate ("1 - HBOC_CLN"), False
Application.SendKeys (YesKey), True
Application.SendKeys (EnterKey), True
'Say Yes to Add account to HPM index tranferring changes
Application.Wait (Now + TimeValue("00:00:03"))
AppActivate ("1 - HBOC_CLN"), False
Application.SendKeys (YesKey), True
Application.SendKeys (EnterKey), True
'===========================================================
'End of the STAR Code
'===========================================================
rowkey = rowkey + 1
AppActivate ("Microsoft Excel - SendKey_UMMC.xls"), False
Application.Sheets("Accounts").Select
Range("A" & rowkey).Select
AccountKey = Range("A" & rowkey)
Application.Wait (Now + TimeValue("00:00:03"))
Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = c.Value & "_01"
Next
Loop Until AccountKey = "END"
End Sub