Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
I'd like to add a "1" (number one) in front of everything in column A. I can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Is there anyone who can help me with this? -- alexm999 ------------------------------------------------------------------------ alexm999's Profile: http://www.excelforum.com/member.php...fo&userid=4918 View this thread: http://www.excelforum.com/showthread...hreadid=490320 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
Post the code that you were using.
Paul "alexm999" wrote in message ... I'd like to add a "1" (number one) in front of everything in column A. I can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Is there anyone who can help me with this? -- alexm999 ------------------------------------------------------------------------ alexm999's Profile: http://www.excelforum.com/member.php...fo&userid=4918 View this thread: http://www.excelforum.com/showthread...hreadid=490320 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
I'd like to add a "1" (number one) in front of everything in column A. I
can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Instead of =1&A1, this might work: =IF(A1="","",1&A1) |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
Try something like this:
Sub Test() For Each cell In Range("A1:A100") cell.Value = 1 & cell.Value Next cell End Sub Regards, Paul "alexm999" wrote in message ... I'd like to add a "1" (number one) in front of everything in column A. I can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Is there anyone who can help me with this? -- alexm999 ------------------------------------------------------------------------ alexm999's Profile: http://www.excelforum.com/member.php...fo&userid=4918 View this thread: http://www.excelforum.com/showthread...hreadid=490320 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
Ok,
Sorry for the multiple posts. That last one still puts the one in blanks. This of cours won't be the only way, and probably not the best way. But you should be able to get what you want with this. Sub Test() For Each cell In Range("A1:A100") If cell.Value = "" Then GoTo skip cell.Value = 1 & cell.Value skip: Next cell End Sub If you want the entire A column, just change that line: For Each cell In Range("A:A") "alexm999" wrote in message ... I'd like to add a "1" (number one) in front of everything in column A. I can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Is there anyone who can help me with this? -- alexm999 ------------------------------------------------------------------------ alexm999's Profile: http://www.excelforum.com/member.php...fo&userid=4918 View this thread: http://www.excelforum.com/showthread...hreadid=490320 |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Adding a "1", please help!
PCLIVE:
When I paste in your macro this line shows up IN RED; If cell.Value = "" Then GoTo skip and, of course when I run the macro I get a "compile error" - syntax/// What's happening?????? TIA,, "PCLIVE" wrote in message ... Ok, Sorry for the multiple posts. That last one still puts the one in blanks. This of cours won't be the only way, and probably not the best way. But you should be able to get what you want with this. Sub Test() For Each cell In Range("A1:A100") If cell.Value = "" Then GoTo skip cell.Value = 1 & cell.Value skip: Next cell End Sub If you want the entire A column, just change that line: For Each cell In Range("A:A") "alexm999" wrote in message ... I'd like to add a "1" (number one) in front of everything in column A. I can use =1&A1 but it's too tedius to do to every record in every spreadsheet. I tried creating a macro, but for blank rows say A1 to A100 have numbers, but after that it adds a 1 in an empty cell. Is there anyone who can help me with this? -- alexm999 ------------------------------------------------------------------------ alexm999's Profile: http://www.excelforum.com/member.php...fo&userid=4918 View this thread: http://www.excelforum.com/showthread...hreadid=490320 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to display 5.5 hours instead of 5.30 when adding \ subtracting | Excel Discussion (Misc queries) | |||
adding vertical bars to an embedded chart using VBA | Excel Discussion (Misc queries) | |||
Adding Rows | Excel Discussion (Misc queries) | |||
help neede with adding times | Excel Discussion (Misc queries) | |||
problem adding | Excel Discussion (Misc queries) |