Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-02-2019, 06:05 AM
taryn taryn is offline Copy row and change details Windows 10 Copy row and change details Office 2016
Novice
Copy row and change details
 
Join Date: Jan 2015
Location: Gibraltar
Posts: 21
taryn is on a distinguished road
Default Copy row and change details

Hello

I have created a macro in Excel (using the Record Macro function) that inserts a copy of row 13 and changes some of the details in the copied row (please see code below). Is it possible to amend the code so that it copies a highlighted row instead of always row 13 and changes the details of the new row?

Kind regards.

Taryn
=================================

Sub BankCharges()
'
' BankCharges Macro
' Inserts Bank Charges Script (JNW1)
'
' Keyboard Shortcut: Ctrl+Shift+B
'
Rows("13:13").Select
Selection.Copy
Selection.Insert Shift:=xlDown
Rows("14:14").Select
Selection.Font.Bold = False
Range("H14").Select


ActiveCell.FormulaR1C1 = "8920"
Range("I14").Select
ActiveCell.FormulaR1C1 = "8920"
Range("K14").Select
ActiveCell.FormulaR1C1 = "NL"
Range("O14").Select
ActiveCell.FormulaR1C1 = "=0-R[-1]C"
Range("O15").Select
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar view showing body or event details - how do you change? smf1234 Outlook 0 07-12-2019 01:46 PM
Project details rhjones19 Project 0 08-15-2017 12:59 PM
change 'Found.EntireRow.Copy' to a # of columns trevorc Excel Programming 2 01-08-2017 12:40 AM
Want to change Macro to copy and paste data to new sheet Vortex69 Excel Programming 0 12-23-2014 09:53 PM
Copy row and change details Need help copy and pasting from internet to word, font change sizes. pearce88 Word 3 11-19-2009 11:27 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:31 AM.


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