Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
alexm999
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Jay
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
JMay
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display 5.5 hours instead of 5.30 when adding \ subtracting excel novice Excel Discussion (Misc queries) 4 November 26th 05 04:22 AM
adding vertical bars to an embedded chart using VBA Wazooli Excel Discussion (Misc queries) 0 November 15th 05 05:47 PM
Adding Rows Richard Excel Discussion (Misc queries) 1 October 10th 05 03:58 PM
help neede with adding times rvnwdr Excel Discussion (Misc queries) 1 June 17th 05 02:15 PM
problem adding rvnwdr Excel Discussion (Misc queries) 2 June 8th 05 06:36 PM


All times are GMT +1. The time now is 12:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"