Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-22-2022, 03:53 AM
Marcia's Avatar
Marcia Marcia is offline Move active cell down Windows 10 Move active cell down Office 2019
Expert
Move active cell down
 
Join Date: May 2018
Location: Philippines
Posts: 526
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default 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.
Attached Files
File Type: xlsm WtaxEntries.xlsm (16.9 KB, 5 views)
Reply With Quote
  #2  
Old 06-22-2022, 05:46 AM
p45cal's Avatar
p45cal p45cal is offline Move active cell down Windows 10 Move active cell down Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

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
You get the drift.
Reply With Quote
  #3  
Old 06-22-2022, 04:10 PM
Marcia's Avatar
Marcia Marcia is offline Move active cell down Windows 10 Move active cell down Office 2019
Expert
Move active cell down
 
Join Date: May 2018
Location: Philippines
Posts: 526
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move active cell down 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
Move active cell down 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft