Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Coding problem

Would someone please show me what is the correct way to code the
following so that my AutoFill Destination goes from Cells(27,2) to
Cells(27,numberofRows)?


ws1.Range("A2").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count

Selection.AutoFill Destination:=ws1.Range("AA2:AA822"),
Type:=xlFillDefault

Thanks,
Jim Berglund
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Coding problem

So you want to fill down in Column B, based on stuff in Column A?

Dim lastrow As Long
lastrow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Range("B2").AutoFill Range("B2:B" & lastrow)


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"jazzzbo" wrote:

Would someone please show me what is the correct way to code the
following so that my AutoFill Destination goes from Cells(27,2) to
Cells(27,numberofRows)?


ws1.Range("A2").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count

Selection.AutoFill Destination:=ws1.Range("AA2:AA822"),
Type:=xlFillDefault

Thanks,
Jim Berglund
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 342
Default Coding problem

Try this:

ws1.Range("A2").Select
numberofRows =
ActiveCell.CurrentRegion.Rows(ActiveCell.CurrentRe gion.Rows.Count).Row
ws1.Range("AA2").AutoFill Destination:=Range("AA2:AA" & numberofRows),
Type:=xlFillDefault

Tom

"jazzzbo" wrote:

Would someone please show me what is the correct way to code the
following so that my AutoFill Destination goes from Cells(27,2) to
Cells(27,numberofRows)?


ws1.Range("A2").Select
numberofRows = ActiveCell.CurrentRegion.Rows.Count

Selection.AutoFill Destination:=ws1.Range("AA2:AA822"),
Type:=xlFillDefault

Thanks,
Jim Berglund
.

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
Help with my coding problem? Dan the Man[_2_] Excel Worksheet Functions 3 September 11th 07 12:02 AM
If, Then, Else Coding Problem BEEJAY Excel Programming 4 May 30th 06 08:26 PM
problem with coding Subs Excel Programming 5 September 26th 05 03:56 PM
Please help: Coding Problem Tim Excel Programming 4 June 28th 05 05:41 AM
Coding problem John[_105_] Excel Programming 3 June 22nd 05 05:39 PM


All times are GMT +1. The time now is 04:57 PM.

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"