#1
|
||||
|
||||
Move active cell down
Hi all. One of the office daily task is to enter disbursement transactions in a spreadsheet. To facilitate the encoding of procurement transactions that involve the computation of witholding taxes, I made an attempt to create a macro by using the "Record macro" tool. In the first 4 rows, the macro is working fine but when it is run several rows down, the cursor goes back to E6.
I found a sample vba with something like offset but when I pasted it in another line, there was an error message so I deleted it. Would somebody please edit the "Range("E5").Select" "Range("E6").Select" lines please. Thank you. |
#2
|
||||
|
||||
Something along the lines of:
Code:
Sub NV_Goods() ' ' NV_Goods Macro ' Witholding Taxes on Non VAT Goods. ' ' ActiveCell.FormulaR1C1 = "=ROUND(R[-1]C[-1]*0.01,2)" ActiveCell.Offset(1).FormulaR1C1 = "=ROUND(R[-2]C[-1]*0.01,2)" ActiveCell.Offset(2).FormulaR1C1 = "=R[-3]C[-1]-R[-2]C-R[-1]C" ActiveCell.Offset(3).Select End Sub Sub NV_Services() ' ' NV_Services Macro ' Witholding Taxes on Non VAT Services ' ' ActiveCell.FormulaR1C1 = "=ROUND(R[-1]C[-1]*0.02,2)" ActiveCell.Offset(1).FormulaR1C1 = "=ROUND(R[-2]C[-1]*0.01,2)" ActiveCell.Offset(2).FormulaR1C1 = "=R[-3]C[-1]-R[-2]C-R[-1]C" ActiveCell.Offset(3).Select End Sub |
#3
|
||||
|
||||
Thank you p45cal. It is perfect. You are an angel to a 3 yrs shy of joining the indilli. The old folks in our place cannot correctly pronounce elderly so nearest is indilli
Yeah I offset it is. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change active cell after running macro in active cell via selection change | Peterson | Excel Programming | 3 | 03-07-2021 12:19 PM |
Cell equal value new value of active cell which is a drop down | hassanmoukadem | Excel Programming | 1 | 04-13-2020 07:54 PM |
Find last non empty cell (moving horizontally), then move one cell to the right | klutch | Word VBA | 9 | 07-09-2018 06:16 PM |
extract time from a cell and move it to front of cell before text | ewso | Excel | 20 | 03-19-2017 11:34 AM |
Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow | FUGMAN | Excel Programming | 7 | 02-05-2017 08:37 AM |