PDA

View Full Version : Changing numberformat



uaku
02-16-2012, 12:58 PM
Hi,
I have over 100 spreadsheets with "SampleID" going from 1 to 100.
I want to read this from each spreadsheet and concatenate to a string called "WSD1122".

Before concatenation I want to change the number to a fixed length 5 digit string like "00001" ... "00100"

so that my final value of sample ID would look like WSD112200001 ..... WSD112200100

I would appreciate your help.

CatDaddy
02-16-2012, 01:13 PM
Range("A1").value = "WSD1122" & Format(Range("A1").value, "00000")

Paul_Hossler
02-17-2012, 03:57 PM
100 different workbooks or 1 workbook with 100 sheets?

Does the SampleID occur in the same place

Does it occur more than once on a worksheet.

Maybe a sample would help

Paul