Change value of cells

Boris7265

Board Regular
Joined
Apr 6, 2011
Messages
68
Hello to all of you,

I am woking on one small excel spreadsheet on my job and in the process I need to change in column A clients name( this is bank name) on "regardless" based on value of cells in column J(value in column J is "2" or "4" in order to bank to change to "Regardless" in column A ). I have written a macro to do that, but it doesn't work;

Dim c5 As Range
Dim Lastrow1 as Range
Dim SrchRng5
Dim Bcell As Range
Lasrow1=Cells(Rows.Count, "A").End(xlUp).Row

Do
Set Bcell = ActiveSheet.Range("A1", ActiveSheet.Range("A1:A" & Lastrow1).End(xlUp))
Set SrchRng5 = ActiveSheet.Range("J1", ActiveSheet.Range("J1:J" & Lastrow1).End(xlUp))
Set c5 = SrchRng5.Find("2", LookIn:=xlValues)
If Not c5 Is Nothing Then Bcell.Value = "Regardless"
Loop While Not c5 Is Nothing.

I don't know what I have done wrong in the macro.It is relly would easy my job if you point me where mistake is.
THANK YOU in advanc eforyour help.
Best Reagrds,

BorisGomel
.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hello Boris,

Please show a table with various values, and explain what do you want changed
or replaced. Your explanation is unclear.

HTH

Gabor
 
Upvote 0
Thank you seboseszuk,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
The spreadsheet has like this arrangement:
<o:p> </o:p>
<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:Street w:st="on"><st1:address w:st="on">BankName Cost DebtorName Court</st1:address></st1:Street> Expenses IDExpenses
CITIBANK 50 RICARDH ROT <st1:City w:st="on"><st1:place w:st="on">MIAMI</st1:place></st1:City> Filling FEES 1
CAPONE 188 Roy Blank Broward Open Fees 2

The spreadsheet is being populated off the bank txt files that we receive over the internet. Then we upload this spreadsheet to our accounting system Oracle to print checks out for the clients. When we upload to ORACLE , I sort the spreadsheet by clients name ( banks) in alphabetical order , however, some expenses-Opening fees ( ID is 2) , garnishment fees ( ID is 4) the bank is regardless -the checks are needed to be printed in alphabetic order by the last names of the debtors. So, I have decided to change value in column A ( Bankname to “regardless” for these Expenses and highlight the part of the spreadsheet where column A value “ regardless” and sort it by the last name of the debtor. Last names are in column N
<o:p> </o:p>
Thank you for your help.
<o:p> </o:p>
Best Regards,
<o:p> </o:p>
BorisGomel
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

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