#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Row spec

Hello again,

Another small simple question for someone that knows how.

How do i adapt this code in order to stop copying at row 109 maximum? So
its max copying range is 11 to 109 inclusive.

LastRow = Range("E" & Rows.Count).End(xlUp).Row
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

Thanks
LiAD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Row spec

see below

"LiAD" wrote:

Hello again,

Another small simple question for someone that knows how.

How do i adapt this code in order to stop copying at row 109 maximum? So
its max copying range is 11 to 109 inclusive.

LastRow = Range("E" & Rows.Count).End(xlUp).Row

If LastRow109 then lastRow = 109

Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

Thanks
LiAD

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Row spec

Try

LastRow = Range("E" & Rows.Count).End(xlUp).Row
If LastRow 109 then
LastRow = 109
End If
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

--
---------------------------
Mauro Gamberini
http://www.riolab.org/
http://blog.maurogsc.eu/
http://social.microsoft.com/Forums/i...ficeit/threads


"LiAD" ha scritto nel messaggio
...
Hello again,

Another small simple question for someone that knows how.

How do i adapt this code in order to stop copying at row 109 maximum? So
its max copying range is 11 to 109 inclusive.

LastRow = Range("E" & Rows.Count).End(xlUp).Row
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

Thanks
LiAD



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Row spec

OK,

Thanks for this. It does stop it at row 109, which I thought would have
solved my problem, but it doesn't for some reason.

I have a table of values which are copy pasted from other sources using a
macro. I have only data in cells C10-O15, the rest until row 109 are empty,
no formulas either.

When i run this macro it is copying the formulas down in all cells from 11
to 109, even the ones with an empty E cell. Even if i hit delete in the E
cells that are empty before i run the macro it still doesnt work.

Do you know why this would be or how I would fix it?

Sub CopyFormulas()

Sheets("1").Select

lastRow = Range("E" & Rows.Count).End(xlUp).Row
If lastRow 109 Then lastRow = 109
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & lastRow),
Type:=xlFillDefault

End Sub

Thanks
LiAD

"Patrick Molloy" wrote:

see below

"LiAD" wrote:

Hello again,

Another small simple question for someone that knows how.

How do i adapt this code in order to stop copying at row 109 maximum? So
its max copying range is 11 to 109 inclusive.

LastRow = Range("E" & Rows.Count).End(xlUp).Row

If LastRow109 then lastRow = 109

Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

Thanks
LiAD

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Row spec

Thanks.

Tried and works but I get the same issue as my reply to Patrick with the
copying formulas into rows where cell E is empty.

Thanks

"Mauro Gamberini" wrote:

Try

LastRow = Range("E" & Rows.Count).End(xlUp).Row
If LastRow 109 then
LastRow = 109
End If
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

--
---------------------------
Mauro Gamberini
http://www.riolab.org/
http://blog.maurogsc.eu/
http://social.microsoft.com/Forums/i...ficeit/threads


"LiAD" ha scritto nel messaggio
...
Hello again,

Another small simple question for someone that knows how.

How do i adapt this code in order to stop copying at row 109 maximum? So
its max copying range is 11 to 109 inclusive.

LastRow = Range("E" & Rows.Count).End(xlUp).Row
Range("P11:AC11").AutoFill Destination:=Range("P11:AC" & LastRow),
Type:=xlFillDefault

Thanks
LiAD




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
Keep text matching a wildcard spec in replace/substitute Hershmab Excel Worksheet Functions 3 September 12th 09 08:28 PM
Spec. Sheet Muskrat24 Excel Worksheet Functions 8 June 16th 09 08:16 PM
Excel's Spec? gabch[_13_] Excel Programming 5 April 20th 06 05:55 AM
Formula for YTD total of Vac. Hrs. used for spec. employee DebbieDoo Excel Worksheet Functions 1 April 29th 05 01:36 AM
FileDialog Folder selection spec Alan Excel Programming 4 February 21st 04 04:41 AM


All times are GMT +1. The time now is 03:04 AM.

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

About Us

"It's about Microsoft Excel"