Solved

Way to Auto populate a column index

Posted on 2013-05-30
2
237 Views
Last Modified: 2016-11-23
I'm trying to figure out a way to have a button where it takes a column and with the information automatically add a ampersand and a unique number down a column (example:
A2 = BING&1
A3 = BING&2
A4 = DELL&3
A5 = IBM&4

So the individual would just enter BING, DELL, OR IBM in column A and after a button is pressed it gives it an ampersand and a unique number. I tried to do a simple IF statement telling to do a concatenate of column A an Ampersand and then a unique number in another column if there is a value in column A. But of course I get a circular reference.
IdentifyingColumn.xlsm
0
Comment
Question by:Southern_Gentleman
2 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 39208666
Hi,

You will need a temporary column, say, [F], that will hold the value of the corresponding value from column [A] &, the row number.

For example:
F1=A1&ROW()

However, in your workbook, the data starts on row 2, so:

F2=A2&ROW()

Then cell [F1] (or [F2]) would be copied down column [F] to the extent of the data in column [A].

The contents of column [F] would then be copied over the top of column [A] as values.

Column [F] would then be cleared or deleted.

Do you need help with such steps (in Microsoft Visual Basic for Applications code)?

BFN,

fp.
0
 

Author Closing Comment

by:Southern_Gentleman
ID: 39209763
Thanks BFN, I actually went ahead and did it the way of VBA.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

746 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

12 Experts available now in Live!

Get 1:1 Help Now