Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Fill Down, Column E

I am trying to fill a range in Column E, where there is data in E5 & E10, and
I wanted to be able to auto fill down, but only the blank cells. I wanted
the last row in Column E to be filled down to the last row in Column A that
is used. My macro doesnt seem to do anything.

Sub AutoFill()

Dim myR As Range
Set myR = Cells(Rows.Count, 1).End(xlUp).Offset(-1, 0).Resize(1, 5)

On Error Resume Next
myR.AutoFill Destination:=Range _
(myR, myR.Offset(0, 5).End(xlDown).Offset(0, -1))

End Sub

Can someone please help out?

Regards,
Ryan---



--
RyGuy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Fill Down, Column E

Hi Ryan,

Does work for you?

Option Explicit
Sub AutoFill()
Dim CountRows As Double
Dim Iloop As Double

'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False

CountRows = Cells(Rows.Count, "A").End(xlUp).Row

For Iloop = 2 To CountRows
If IsEmpty(Cells(Iloop, "E")) Then
Cells(Iloop, "E") = Cells(Iloop - 1, "E")
End If
Next Iloop

'Turn on warnings, etc.
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub


--
Ken Hudson


"ryguy7272" wrote:

I am trying to fill a range in Column E, where there is data in E5 & E10, and
I wanted to be able to auto fill down, but only the blank cells. I wanted
the last row in Column E to be filled down to the last row in Column A that
is used. My macro doesnt seem to do anything.

Sub AutoFill()

Dim myR As Range
Set myR = Cells(Rows.Count, 1).End(xlUp).Offset(-1, 0).Resize(1, 5)

On Error Resume Next
myR.AutoFill Destination:=Range _
(myR, myR.Offset(0, 5).End(xlDown).Offset(0, -1))

End Sub

Can someone please help out?

Regards,
Ryan---



--
RyGuy

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Fill Down, Column E

That's exactly it! I kept thinking I needed something like this:
Selection.FormulaR1C1 = "=R[-1]C"

Well, thanks for getting that straightened out for me!!!



Regards,
Ryan---


--
RyGuy


"Ken Hudson" wrote:

Hi Ryan,

Does work for you?

Option Explicit
Sub AutoFill()
Dim CountRows As Double
Dim Iloop As Double

'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False

CountRows = Cells(Rows.Count, "A").End(xlUp).Row

For Iloop = 2 To CountRows
If IsEmpty(Cells(Iloop, "E")) Then
Cells(Iloop, "E") = Cells(Iloop - 1, "E")
End If
Next Iloop

'Turn on warnings, etc.
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub


--
Ken Hudson


"ryguy7272" wrote:

I am trying to fill a range in Column E, where there is data in E5 & E10, and
I wanted to be able to auto fill down, but only the blank cells. I wanted
the last row in Column E to be filled down to the last row in Column A that
is used. My macro doesnt seem to do anything.

Sub AutoFill()

Dim myR As Range
Set myR = Cells(Rows.Count, 1).End(xlUp).Offset(-1, 0).Resize(1, 5)

On Error Resume Next
myR.AutoFill Destination:=Range _
(myR, myR.Offset(0, 5).End(xlDown).Offset(0, -1))

End Sub

Can someone please help out?

Regards,
Ryan---



--
RyGuy

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Fill Down, Column E

Is the additional line of code what you wanted to know?

Option Explicit

Sub CopyCell1()
Dim X As Long
Dim Sh As Variant
For Each Sh In Array("M", "P", "T", "A", "Mi", "Sm", "H")
For X = 7 To 500
Sheets(Sh).Cells(X, "X") = (Sheets(1).Range("A1") /
Sheets(1).Range(C20)) * 52
Sheets(Sh).Cells(X, "Y") = Sheets(1).Range("C1") +
Sheets(1).Range("D1")
Next
Next
End Sub
--
Ken Hudson


"ryguy7272" wrote:

That's exactly it! I kept thinking I needed something like this:
Selection.FormulaR1C1 = "=R[-1]C"

Well, thanks for getting that straightened out for me!!!



Regards,
Ryan---


--
RyGuy


"Ken Hudson" wrote:

Hi Ryan,

Does work for you?

Option Explicit
Sub AutoFill()
Dim CountRows As Double
Dim Iloop As Double

'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False

CountRows = Cells(Rows.Count, "A").End(xlUp).Row

For Iloop = 2 To CountRows
If IsEmpty(Cells(Iloop, "E")) Then
Cells(Iloop, "E") = Cells(Iloop - 1, "E")
End If
Next Iloop

'Turn on warnings, etc.
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub


--
Ken Hudson


"ryguy7272" wrote:

I am trying to fill a range in Column E, where there is data in E5 & E10, and
I wanted to be able to auto fill down, but only the blank cells. I wanted
the last row in Column E to be filled down to the last row in Column A that
is used. My macro doesnt seem to do anything.

Sub AutoFill()

Dim myR As Range
Set myR = Cells(Rows.Count, 1).End(xlUp).Offset(-1, 0).Resize(1, 5)

On Error Resume Next
myR.AutoFill Destination:=Range _
(myR, myR.Offset(0, 5).End(xlDown).Offset(0, -1))

End Sub

Can someone please help out?

Regards,
Ryan---



--
RyGuy

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
Automatically fill in third column depending on data in second column J.J. Excel Programming 2 May 11th 07 07:34 PM
Fill a column with the contents of another column based on a choic Sparky56 Excel Discussion (Misc queries) 1 March 31st 07 04:18 AM
Auto Fill Column with Date based on rows in other column JOUIOUI Excel Programming 2 June 6th 06 06:28 PM
What to do to fill column 2 with part of whats in column 1 Edwin Mashiringwani Excel Discussion (Misc queries) 2 November 19th 05 03:57 PM
Fill handle - new column using a column and one cell MS Excel Discussion (Misc queries) 4 November 2nd 05 11:20 PM


All times are GMT +1. The time now is 03:46 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"