Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2012-12-28
2
Medium Priority
?
310 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

688 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