Solved

Fill in a term above certain cells by means of a macro

Posted on 2012-12-28
2
249 Views
Last Modified: 2012-12-29
Dear Experts:

I would like to run a macro that performs the following action:

Loop thru all the cells in Column A.
Whenever the macro hits a 1 (i.e. a cell filled with the value 1 in Column A) it should enter 'beginning' just above the cell where the value 1 is found.

Help is much appreciated. I have attached a sample file for your convenience.

Regards, Andreas

Add-Term-Above-Certain-Cells.xls
0
Comment
Question by:AndreasHermle
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38727352
Sub fillbeginning()
    Dim cel As Range
    For Each cel In ActiveSheet.UsedRange.Columns(1).Cells
        If cel.Offset(1) = 1 Then cel.Value = "Beginning"
    Next cel
End Sub
0
 

Author Closing Comment

by:AndreasHermle
ID: 38728976
Fast code, exactly what I was looking for.

Thank you very much for your professional support.  

Regards, Andreas
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now