Solved

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

Posted on 2012-12-28
2
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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