Cycle through loop and amend cell contents

JAGIUS

New Member
Joined
Apr 6, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi ALL,

I need a VBA macro which will look through a dynamic range (will chnage from month to month) copy a reference number, search for it in another sheet and then chnage the cell contents of another column once that refewrence is found in the other sheet. I then need it to come back to the original sheet and loop throug the next reference number and do the same as mention above.

So in the below the macro starts in cell C3 copies the reference, looks in the 'Instrument' sheet in cell A3 on another sheet, finds the reference in the instument sheet and makes the amendment to the cell as specified in E3. Then it returns to the sheet with the list below and moves down to C4 and so on untill it reaches the last cell.

ABCDE
2​
SheetRef columnReferenceColumn to be AmendedAmedment
3​
InstrumentINSTRMNT_ID002613-ODSB-EUR-016DT_INCPTN
20151228​
4​
InstrumentINSTRMNT_ID002613-ODSB-USD-013DT_INCPTN
20151228​
5​
InstrumentINSTRMNT_ID017627-SUCL-SGD-019DT_INCPTN
20220919​
6​
InstrumentINSTRMNT_ID028116-SUCL-EUR-010DT_INCPTN
20200326​
7​
InstrumentINSTRMNT_ID028116-SUCL-EUR-021DT_INCPTN
20200228​
8​
InstrumentINSTRMNT_ID047229-ODAN-EUR-016DT_INCPTN
20130101​
9​
Protection ReceivedPRTCTN_ID048401-CCFA-USD-007ORGNL_PRTCTN_VL
28126.95426​
10​
Protection ReceivedPRTCTN_ID048725-CCFA-USD-008ORGNL_PRTCTN_VL
205180.0000​

I have no idea how to start this.....


Any ideas wold be very much appriciated
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Can you have a formula in column E to look up the required value?
 
Upvote 0
Can you have a formula in column E to look up the required value?
The value is based on the reference in column C. I guess essentially a VLOOKUP but once the value is found it has to be updated with that of column E
 
Upvote 0
Does the value in column E always depend on the value in column C?

Is so, then, by having a formula it will be dynamic.
 
Upvote 0
Does the value in column E always depend on the value in column C?

Is so, then, by having a formula it will be dynamic.
yes beacuse without the reference you will not know what row the chnage has to be applied to. This is to save the user having to do the chnages manually each month untill the chnages are fixed at source. As mentioned, they will be added to each month
 
Upvote 0

Forum statistics

Threads
1,215,223
Messages
6,123,714
Members
449,118
Latest member
MichealRed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top