Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default VBA and insert question

Hello

I hve some code that inserts 4 lines into a spreadsheet one at a time

Is there a line of code that would permit me to put in 4 lines in one go?

Many thanks

With Sheets("sheet1").Range("BL1:BX1")
.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End With
With Sheets("sheet1").Range("BL1:BX1")
.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End With
With Sheets("sheet1").Range("BL1:BX1")
.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End With
With Sheets("sheet1P").Range("BL1:BX1")
.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End With


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default VBA and insert question

Hi

Expand the range to be 4 rows:

With Sheets("Sheet1").range("BL1:BX4")
....


Regards,
Per

On 2 Jan., 01:16, "teepee" wrote:
Hello

I hve some code that inserts 4 lines into a spreadsheet one at a time

Is there a line of code that would permit me to put in 4 lines in one go?

Many thanks

With Sheets("sheet1").Range("BL1:BX1")
* * .Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
* * End With
* * With Sheets("sheet1").Range("BL1:BX1")
* * .Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
* * End With
* * With Sheets("sheet1").Range("BL1:BX1")
* * .Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
* * End With
* * With Sheets("sheet1P").Range("BL1:BX1")
* * .Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
* * End With


  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default VBA and insert question


"Per Jessen" wrote .
Hi

Expand the range to be 4 rows:

D'oh thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA and insert question teepee[_3_] Excel Discussion (Misc queries) 3 January 2nd 09 01:51 PM
An 'Insert' question teepee[_3_] Excel Discussion (Misc queries) 3 December 28th 08 12:10 PM
An 'Insert' question teepee[_3_] Excel Programming 3 December 28th 08 12:10 PM
Excel insert question Kevin W[_2_] Excel Worksheet Functions 2 June 13th 08 05:41 PM
Chart question insert Alfred Excel Worksheet Functions 2 November 4th 04 08:03 PM


All times are GMT +1. The time now is 01:24 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"