Avatar of thebest8
thebest8

asked on 

Excel: increment numbers in reference

Hello Experts,

I have a column named: image_ref and I have a list of references folders, what I want to achieve is this :

I have like 50 references and would like to have them in order automatically without typing one by one.

The first reference starts with AJ001
the next should be AJ001 and third AJ003, so you guessed the rest, right? :)

How to that automatically with Excel?

Thank you
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
thebest8
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Select the first reference. Hover the mouse over the lower right-hand corner until it's a plus sign and drag down.
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of thebest8
thebest8

ASKER

Wow dear Martin, that was confusing, forgive me for my basic knowledge, so where to put that code? or how to use it?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Sorry about that. I've attached a sample workbook that contains a slightly modified and documented version of the code. If you go to Visual Basic via Alt+f11 and you double-click on Sheet1 in the Project - VBA Project window you'll see the code.
29066164.xlsm
Avatar of thebest8
thebest8

ASKER

So this involves VisualBasic, I don't have it installed and I don't use it at all...

Let me ask you this, how can I do this through a web script? possible?
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

No. It involves Visual Basic for Applications, better known as VBA. VBA is built into Excel and all other Office applications including Excel.
Avatar of thebest8
thebest8

ASKER

Thank you very much dear Martin, I will try to achieve it with a php loop then copy/paste it. thanks alot
Avatar of thebest8
thebest8

ASKER

thank you
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
Avatar of thebest8
thebest8

ASKER

Ok, thank you, this is how I achieved it:

<?php

for($counter = 1; $counter <= 50; $counter++)

	
			print "AJ0" . "$counter" . "<br>";
		
	
?>

Open in new window

Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo