Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2010, 01:43 PM
Registered User
 
Join Date: Jan 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple Select Copy Paste

I trying to come up with VBA code that will allow me to multiple select, insert blank rows, and then populate the new (blank) rows with text (copy/paste range (B1:N1 the header row).
The code below will allow a single entry but I can’t come up with the VBA code to allow for a multiple select.
I’ve tried looping, autofilter, and a number of different approaches but nothing is working I think the problem rests with 'ActiveCel'l but not sure.
Thanking you in advance.

Code:
Sub Insert_Header()

	“NOTE: First row of worksheet (“B1:N1”) is header
	
	Application.ScreenUpdating = False

	‘Insert Blank row where selected in spreadsheet
		Selection.EntireRow.Insert

	‘Select blank rows & copy/paste header
		Range(“B:B”).SpecialCells(xlCellTypeBlanks).Select
		Range(“B1:N1”).Copy ActiveCell
		Application.CutCopyMode = False

	Application.ScreenUpdating = True

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Select Copy Paste Jay999 Excel VBA 1 February 26th, 2010 03:17 AM
Copy and Paste the value waka Excel VBA 7 October 28th, 2009 10:08 PM
copy paste !!!!!!! dpkbahuguna Beginning VB 6 1 March 30th, 2007 10:06 AM
Copy, Paste dpkbahuguna Beginning VB 6 1 October 26th, 2006 10:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.