Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Autofill not working.

Am trying to get my Autofill Macro to select the last filled cell in column A
and autofill down. The autofill must stop based on the data in column F.
For example, A has one entry and F has 10. I want "A" to autofill down to
the end of entries in "F, so I want A to fill down to 10. I have the
following code, but it is not executing...???

Thanks!

Sub AutoFill_Plot_Points()

Dim LastRow As Long
Dim RngToCopy As Range
Dim HowManyRows As Long

With Sheets("Plot_Point_Data")
LastRow = .Cells(.Rows.Count, "F").End(xlUp).Row

'using the last used cell in column A to get the row to copy
Set RngToCopy = .Cells(.Rows.Count, "A").End(xlUp)

HowManyRows = LastRow - RngToCopy.Row + 1

If HowManyRows 1 Then
RngToCopy.Resize(HowManyRows, 4).FillDown
End If
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Autofill not working.

Checked With Sheets("Plot_Point_Data").
All good, still not executing. Any chance it could be because col A and B
are merged in ("Plot_Point_Data")??
A1 is ususally an integer as well?...?
TIA



"Don Guillett" wrote:

Although I would have written in a more simplified manner, I just tested
your code with a formula in a1 and data in col F. Worked. Check With
Sheets("Plot_Point_Data")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"el dee" wrote in message
...
Am trying to get my Autofill Macro to select the last filled cell in
column A
and autofill down. The autofill must stop based on the data in column F.
For example, A has one entry and F has 10. I want "A" to autofill down to
the end of entries in "F, so I want A to fill down to 10. I have the
following code, but it is not executing...???

Thanks!

Sub AutoFill_Plot_Points()

Dim LastRow As Long
Dim RngToCopy As Range
Dim HowManyRows As Long

With Sheets("Plot_Point_Data")
LastRow = .Cells(.Rows.Count, "F").End(xlUp).Row

'using the last used cell in column A to get the row to copy
Set RngToCopy = .Cells(.Rows.Count, "A").End(xlUp)

HowManyRows = LastRow - RngToCopy.Row + 1

If HowManyRows 1 Then
RngToCopy.Resize(HowManyRows, 4).FillDown
End If
End With
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Autofill not working.

If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"el dee" wrote in message
...
Checked With Sheets("Plot_Point_Data").
All good, still not executing. Any chance it could be because col A and B
are merged in ("Plot_Point_Data")??
A1 is ususally an integer as well?...?
TIA



"Don Guillett" wrote:

Although I would have written in a more simplified manner, I just tested
your code with a formula in a1 and data in col F. Worked. Check
With
Sheets("Plot_Point_Data")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"el dee" wrote in message
...
Am trying to get my Autofill Macro to select the last filled cell in
column A
and autofill down. The autofill must stop based on the data in column
F.
For example, A has one entry and F has 10. I want "A" to autofill down
to
the end of entries in "F, so I want A to fill down to 10. I have the
following code, but it is not executing...???

Thanks!

Sub AutoFill_Plot_Points()

Dim LastRow As Long
Dim RngToCopy As Range
Dim HowManyRows As Long

With Sheets("Plot_Point_Data")
LastRow = .Cells(.Rows.Count, "F").End(xlUp).Row

'using the last used cell in column A to get the row to copy
Set RngToCopy = .Cells(.Rows.Count, "A").End(xlUp)

HowManyRows = LastRow - RngToCopy.Row + 1

If HowManyRows 1 Then
RngToCopy.Resize(HowManyRows, 4).FillDown
End If
End With
End Sub




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
Autofill cell reference forumula not working James D Excel Worksheet Functions 4 August 28th 09 05:11 PM
autofill using mouse is not working in excel 2001 [email protected] Excel Discussion (Misc queries) 4 November 3rd 07 04:05 AM
Autofill Function no longer Working Helpmepleaze Excel Worksheet Functions 1 August 17th 07 02:17 AM
AutoFill isnt working? M.L Excel Discussion (Misc queries) 7 June 16th 05 08:58 PM
Q. Autofill question: Can I autofill alpha characters like I can numbers? George[_22_] Excel Programming 5 August 7th 04 10:33 AM


All times are GMT +1. The time now is 08:14 PM.

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"