Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default contextures fill in cells

Hi, Debra:

I often append data to the end of an older column of data, and want to leave
the old blank cells blank. How do I modify your macro in
http://www.contextures.com/xlDataEntry02.html to limit the fill-in to a
range, (in this case, the new data) rather than the entire column?

Thank you,

- Victoria

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default contextures fill in cells

I'm not Debra, but ...

Select the range to fix and try this macro. (Remember to save first--just in
case it doesn't work the way you want. Then you can close without saving and
get your workbook back the way it was.)

Option Explicit
Sub FillColBlanks2()

Dim rng As Range

Set rng = Nothing
On Error Resume Next
Set rng = Intersect(Selection, _
Selection.Cells.SpecialCells(xlCellTypeBlanks))
On Error GoTo 0

If rng Is Nothing Then
MsgBox "No blanks found"
Exit Sub
Else
rng.FormulaR1C1 = "=R[-1]C"
End If

'replace formulas with values
With Selection
.Value = .Value
End With

End Sub




VAMS wrote:

Hi, Debra:

I often append data to the end of an older column of data, and want to leave
the old blank cells blank. How do I modify your macro in
http://www.contextures.com/xlDataEntry02.html to limit the fill-in to a
range, (in this case, the new data) rather than the entire column?

Thank you,

- Victoria


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default contextures fill in cells

Thank you!

"Dave Peterson" wrote:

I'm not Debra, but ...

Select the range to fix and try this macro. (Remember to save first--just in
case it doesn't work the way you want. Then you can close without saving and
get your workbook back the way it was.)

Option Explicit
Sub FillColBlanks2()

Dim rng As Range

Set rng = Nothing
On Error Resume Next
Set rng = Intersect(Selection, _
Selection.Cells.SpecialCells(xlCellTypeBlanks))
On Error GoTo 0

If rng Is Nothing Then
MsgBox "No blanks found"
Exit Sub
Else
rng.FormulaR1C1 = "=R[-1]C"
End If

'replace formulas with values
With Selection
.Value = .Value
End With

End Sub




VAMS wrote:

Hi, Debra:

I often append data to the end of an older column of data, and want to leave
the old blank cells blank. How do I modify your macro in
http://www.contextures.com/xlDataEntry02.html to limit the fill-in to a
range, (in this case, the new data) rather than the entire column?

Thank you,

- Victoria


--

Dave Peterson

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
Dependent Drop-Downs (Contextures web site) Pepper New Users to Excel 3 October 4th 08 01:06 AM
Fill cells with color based on criteria in two cells AA Excel Worksheet Functions 2 January 2nd 06 11:29 PM
How do I fill (copy) nonadjacent cells to adjacent cells? BuckyGeorge Excel Discussion (Misc queries) 2 December 22nd 05 04:18 AM
create a fill in template to tab to fill in cells Excel-erator Excel Discussion (Misc queries) 2 July 6th 05 09:57 PM
HOW TO FORMATE CELLS TO COUNT CELLS WITH A FILL COLOR? Moore New Users to Excel 1 June 15th 05 06:41 PM


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