Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mary
 
Posts: n/a
Default Fill blank cells with cells above data

I have a spreadsheet with that I recorded a macro to copy several adjacent
cell data from the row above it, however, if I try re-using that macro it
uses the cell numbers in the original macro and not the new row I am working
on.

Is there a way of looking where my cursor is at and then copying the only a
certain number of cells from the row above it - not the entire row?

Appreciate the assistance and expertise as always.
Mary
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default Fill blank cells with cells above data

When you record the macro you see a small box with two icons - one to
stop recording (on the left) and another to switch from absolute
references (default) to relative references. You should start recording
another macro and immediately click on the relative reference icon.
After recording you can view your code in the VBE editor and see the
differences.

Hope this helps.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mary
 
Posts: n/a
Default Fill blank cells with cells above data

Pete - thank you so much, this worked!

"Pete" wrote:

When you record the macro you see a small box with two icons - one to
stop recording (on the left) and another to switch from absolute
references (default) to relative references. You should start recording
another macro and immediately click on the relative reference icon.
After recording you can view your code in the VBE editor and see the
differences.

Hope this helps.

Pete


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default Fill blank cells with cells above data

Glad to help - thanks for getting back.

Pete

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Fill blank cells with cells above data

Try this function:

Sub FillDown()
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("B4:B1000").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=R[-1]C"
End Sub

Note: B2 whould be the first cell in the column that contains data; adjust
range to suit


--
RyGuy


"Pete" wrote:

Glad to help - thanks for getting back.

Pete




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Fill blank cells with cells above data

Whoops, I meant to say subroutine, not function...........

--
RyGuy


"Pete" wrote:

Glad to help - thanks for getting back.

Pete


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Fill blank cells with cells above data

You do realise that this thread was from a year ago ??

Pete

On Feb 6, 3:40 am, ryguy7272
wrote:
Whoops, I meant to say subroutine, not function...........

--
RyGuy



"Pete" wrote:
Glad to help - thanks for getting back.


Pete- Hide quoted text -


- Show quoted text -



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Fill blank cells with cells above data

Hi Pete - Do you know how to run it on a different row each time?

"Pete_UK" wrote:

You do realise that this thread was from a year ago ??

Pete

On Feb 6, 3:40 am, ryguy7272
wrote:
Whoops, I meant to say subroutine, not function...........

--
RyGuy



"Pete" wrote:
Glad to help - thanks for getting back.


Pete- Hide quoted text -


- Show quoted text -




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
Blank cells and Charting multiple data points willisj Charts and Charting in Excel 1 November 10th 05 12:29 AM
enter numbers in blank cells bill gras Excel Worksheet Functions 2 September 21st 05 01:17 PM
pivot tables reports - altering display of (blank) cells cak Excel Worksheet Functions 1 August 22nd 05 12:39 AM
FILL IN BLANK CELLS Charles Excel Discussion (Misc queries) 2 August 8th 05 07:07 PM
Blank Cells in Pivot Tables Greg Excel Discussion (Misc queries) 1 March 16th 05 09:23 PM


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