New Challenge for the Talented Souls

rachel_apartm

New Member
Joined
Oct 19, 2018
Messages
1
Here is the challenge (maybe not for some):
I am looking for a way to automate some of the manual steps for a daily task using formulas, VBA/Macro. For the task, the basic steps are the following:

Step one: find specific accounts such as accounts begin with "051- something"
Step two: highlight these accounts
(the filtering function does not necessary help because I would need to un-filter everything at the end)
Step three: make the manual adjustments (zeroing the values)

Zeroing the account is demonstrated below:
3456356
3626737
45637442414

<tbody>
</tbody>

I would need to copy these values and paste them on the right next to the very last column. Then manually insert = and - and they look like this:

B2C2D2E2F2G2H2I2
=345-G3=63-H3=56-I33456356
=362-G5=6-H5=737-I53626737
=4563-G6=744-H6=2414-I645637442414

<tbody>
</tbody>

As you can see, this this very tedious to do for many accounts and different excel sheet. The reason to do so instead of putting zeros is just to leave a paper trial where everyone can see which and where adjustments are made.

Any brave souls taking the challenge?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Is there only one adjustment per cell?
- if so, the values in columns G H & I could be derived using VLookup (no need to search etc) - use IfError around VLookup to convert all errors to 0 (zero)

This method writes the formulas in the cells in columns B D & E

Code:
Sub Zero()

    Dim cell As Range, rng As Range
    Set rng = Range("B2:B10")
    For Each cell In rng
        With cell
            .Formula = "=" & .Value & "-" & .Offset(, 4).Address(0, 0)
            .Offset(, 2).Formula = "=" & .Offset(, 2).Value & "-" & .Offset(, 5).Address(0, 0)
            .Offset(, 3).Formula = "=" & .Offset(, 3).Value & "-" & .Offset(, 6).Address(0, 0)
        End With
    Next cell

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,299
Messages
6,124,132
Members
449,143
Latest member
LightArisen

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