# Eggplant- insert value into specific cell

**URL:** <https://forums.eggplantsoftware.com/t/eggplant-insert-value-into-specific-cell/7750>\
**Category:** Eggplant Functional\
**Created:** [February 15, 2022, 2:57pm UTC](https://forums.eggplantsoftware.com/t/eggplant-insert-value-into-specific-cell/7750 "2022-02-15T14:57:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rijesh](https://forums.eggplantsoftware.com/letter_avatar_proxy/v4/letter/r/c4cdca/32.png) [@Rijesh](https://forums.eggplantsoftware.com/u/Rijesh)\
**Post date:** [February 15, 2022, 2:57pm UTC](https://forums.eggplantsoftware.com/t/eggplant-insert-value-into-specific-cell/7750/1 "2022-02-15T14:57:25Z")

</div>

Hello,  
Hope you are all doing good.  
Context:  
I am currently automating insufficient fund scenario for different type of payments for a banking app. I need to check if a payment has failed with the message Insufficient fund and mark the payment as Passed. For example, am doing an Own account transfer for which the payment has failed (Insufficient fund), then i need to insert “Passed” into excel sheet beside the payment type.  
My Excel structure:  
 ![Screenshot 2022-02-15 at 18.43.57](https://forums.eggplantsoftware.com/uploads/default/original/1X/15f8b69521f5400e239830bb19792f6fdeeb6732.png)  
Need:  
I do not want to specify the cell to insert the value. For example: put Msg into cell(“C3”) of AllPayment  
What I did:  
Before initiating the transfer, I insert the Payment type in Cell D2, for example D2 contain “Own account transfer”  
Then am taking the whole column A to get the Payment Type, and am comparing the value with cell D2, if the Payment Type = value in cell D2 then insert “Passed” in cell C3 (Currently hardcoded)  
My code:  
set myWorkbook to WorkBook(ResourcePath(“UAT\_Data.xlsx”))  
set AllPayment to myWorkbook.Worksheet(“Juice\_AllPayment”)  
Put cell(AllPayment, “H2”) into Var\_PT  
Set Msg to “Passed”  
//Retrive payment type for local bank transfer from excel  
Put cell(AllPayment, “D5”) into Var\_LocaltransferType  
//Check if payment is fcy  
Put cell(AllPayment, “E5”) into Var\_FCY  
Set LocalCur = “MUR”  
put cellRange(“A”) of AllPayment into paymentType  
log paymentType  
put cellRange(“C”) of AllPayment into C  
Log C  
repeat until Var\_PT is PaymentType  
If Var\_PT equals item 1 of PaymentType and if Var\_FCY is LocalCur then

```
	Log item 1 of PaymentType
	put Msg into cell("C3") of AllPayment --> Here am specifying the cell to insert the value
	Exit repeat
	
else If Var_PT equals item 1 of PaymentType and if Var_FCY is not LocalCur then

	Log item 1 of PaymentType
	put Msg into cell("C17") of AllPayment
	Exit repeat
	
else 

	logError "Payment type not found"

End if
delete the first item of paymentType

```

end repeat

What i want is, if the payment type is in cell A2, then insert he value in Cell C2 without specifying the cell. I want something like put Msg into cell(items) of AllPayment.

Thanking you in advance for your help.

---

<div class="post-metadata">

**Author:** ![DaveHester](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/davehester/32/104_2.png) [@DaveHester](https://forums.eggplantsoftware.com/u/DaveHester)\
**Post date:** [February 16, 2022, 7:46pm UTC](https://forums.eggplantsoftware.com/t/eggplant-insert-value-into-specific-cell/7750/2 "2022-02-16T19:46:18Z")

</div>

I would recommend that you consider moving to connecting to Excel as a database. You can see more information on that here: [Working with Excel](https://docs.eggplantsoftware.com/ePF/SenseTalk/stk-working-with-excel.htm)  
Let us know if you want more info.
