[mso] Re: Excel Code
- From: Thomas Hutchins <hutch99999@xxxxxxxxx>
- To: mso@xxxxxxxxxxxxx
- Date: Wed, 16 Apr 2008 08:55:04 -0700 (PDT)
Try the following macro. Before running it, select the entire range to be
processed (from the first cell with data to the ending row).
Public Sub FillBlanks()
'If only one cell is selected, stop.
If Selection.Count = 1 Then Exit Sub
'Select only the blank cells within the selected range.
Selection.SpecialCells(xlCellTypeBlanks).Select
'Enter a formula to pull the value from the cell above.
Selection.FormulaR1C1 = "=R[-1]C"
'Copy & paste in place as values.
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
Paste the code in a VBA module in your workbook. If you are new to macros, this
link to Jon Peltier's site may be helpful:
http://peltiertech.com/WordPress/2008/03/09/how-to-use-someone-elses-macro/
Hope this helps,
Hutch
Herbert Chitate <herbertc@xxxxxxxxx> wrote:
Hi All,
Can someone help me with a code which does the following:
1) Looks at a cell and if it has something in it, it ignores it, and
goes to the next one down.
2) If the cell is empty, it copies the contents of the cell above it,
and continues to a certain line that I can specify.
Many thanks
Herbert
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join and
share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
- Follow-Ups:
- [mso] Outlook addresses
- From: errol sapir
- [mso] Re: Excel Code
- From: Herbert Chitate
- References:
- [mso] Excel Code
- From: Herbert Chitate
Other related posts:
- » [mso] Excel Code
- » [mso] Re: Excel Code
- » [mso] Re: Excel Code
- » [mso] Re: Excel Code
- » [mso] Re: Excel Code
- [mso] Outlook addresses
- From: errol sapir
- [mso] Re: Excel Code
- From: Herbert Chitate
- [mso] Excel Code
- From: Herbert Chitate