PC Review


Reply
Thread Tools Rate Thread

2 issues really

 
 
srosetti
Guest
Posts: n/a
 
      15th Oct 2009
Ok, yesterday I asked how to append some information on to the end of
a file. Today I have a question with some twists to it.

1)
In Column 'C' I have a product number field. It consists of 5
digits. An example of a product number would be. 00010 The zero's in
front of the 10 are important.
I'll give you other examples so you can fully understand how many
numbers I might have.
00010
00100
01000
10000
Those are basic examples of what they might look like..could be any
counting numbers, but will always have the 0 place holder to bring the
digits to a total of 5.

2)
In Column 'B' I have free form product name. I.e. Widget or Very Very
small widget
I need to append the values in Column 'C' to the end of Text in Column
'B'

My data should look something like this..

Field B2 reads Widget
Field B3 reads Very Very small widget
Field C2 reads 00100
Field C3 reads 00010

I want my final data output in Field B2 and B3 to read
B2 Widget 00100
B3 Very Very small widget 00010

If you have any questions..please feel free to ask.

Thanks
 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      15th Oct 2009
Give this code a try..

Sub ConcatBandC()
Dim X As Long, LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For X = 2 To LastRow
Cells(X, "B").Value = Cells(X, "B").Value & Format( _
Cells(X, "C").Value, " 00000")
Next
End Sub

--
Rick (MVP - Excel)


"broro183" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> hi,
>
> This is posted in the Programming forum but here are a couple of
> non-vba solutions...
>
> 1)
> - select the cells, press [ctrl + 1], Number - Custom, & type 00000
> into the Type field.
> - Or, using a helper column eg column D, type
> Code:
> --------------------
> =TEXT(C1,"00000")
> --------------------
> & copy down as needed.
>
> 2)
> - In a helper column, eg column D, type
> Code:
> --------------------
> =B2 & " " & C2
> --------------------
> , copy down as needed, select all the cells, press [ctrl + c], select
> cell B2 & press [alt + E + S + V] to paste special as values over the
> top of the original data.
>
> If you do still want a macro solution, record a macro as you complete
> the actions manually & then post the recorded code if you need help
> making it flexible.
>
> hth
> Rob
>
>
> --
> broro183
>
> Rob Brockett. Always learning & the best way to learn is to
> experience...
> ------------------------------------------------------------------------
> broro183's Profile:
> http://www.thecodecage.com/forumz/member.php?userid=333
> View this thread:
> http://www.thecodecage.com/forumz/sh...d.php?t=144631
>


 
Reply With Quote
 
srosetti
Guest
Posts: n/a
 
      15th Oct 2009
On Oct 15, 3:11*pm, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Give this code a try..
>
> Sub ConcatBandC()
> * Dim X As Long, LastRow As Long
> * LastRow = Cells(Rows.Count, "B").End(xlUp).Row
> * For X = 2 To LastRow
> * * Cells(X, "B").Value = Cells(X, "B").Value & Format( _
> * * * * * * * * * * * * * Cells(X, "C").Value, " 00000")
> * Next
> End Sub
>
> --
> Rick (MVP - Excel)
>
> "broro183" <broro183.404...@thecodecage.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > hi,

>
> > This is posted in the Programming forum but here are a couple of
> > non-vba solutions...

>
> > 1)
> > - select the cells, press [ctrl + 1], Number - Custom, & type 00000
> > into the Type field.
> > - Or, using a helper column eg column D, type
> > Code:
> > --------------------
> > * *=TEXT(C1,"00000")
> > --------------------
> > & copy down as needed.

>
> > 2)
> > - In a helper column, eg column D, type
> > Code:
> > --------------------
> > * *=B2 & " " & C2
> > --------------------
> > , copy down as needed, select all the cells, press [ctrl + c], select
> > cell B2 & press [alt + E + S + V] to paste special as values over the
> > top of the original data.

>
> > If you do still want a macro solution, record a macro as you complete
> > the actions manually & then post the recorded code if you need help
> > making it flexible.

>
> > hth
> > Rob

>
> > --
> > broro183

>
> > Rob Brockett. Always learning & the best way to learn is to
> > experience...
> > ------------------------------------------------------------------------
> > broro183's Profile:
> >http://www.thecodecage.com/forumz/member.php?userid=333
> > View this thread:
> >http://www.thecodecage.com/forumz/sh...d.php?t=144631

>
>


The code populates my description field perfectly. I'll be sure and
use it.
Thank You so much.
 
Reply With Quote
 
srosetti
Guest
Posts: n/a
 
      15th Oct 2009
On Oct 15, 2:03*pm, broro183 <broro183.404...@thecodecage.com> wrote:
> hi,
>
> This is posted in the Programming forum but here are a couple of
> non-vba solutions...
>
> 1)
> - select the cells, press [ctrl + 1], Number - Custom, & type 00000
> into the Type field.
> - Or, using a helper column eg column D, type
> Code:
> --------------------
> * * =TEXT(C1,"00000")
> --------------------
> *& copy down as needed.
>
> 2)
> - In a helper column, eg column D, type
> Code:
> --------------------
> * * =B2 & " " & C2
> --------------------
> , copy down as needed, select all the cells, press [ctrl + c], select
> cell B2 & press [alt + E + S + V] to paste special as values over the
> top of the original data.
>
> If you do still want a macro solution, record a macro as you complete
> the actions manually & then post the recorded code if you need help
> making it flexible.
>
> hth
> Rob
>
> --
> broro183
>
> Rob Brockett. Always learning & the best way to learn is to
> experience...
> ------------------------------------------------------------------------
> broro183's Profile:http://www.thecodecage.com/forumz/member.php?userid=333
> View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=144631


The Text formatting works great. I think the VBA code below works
easiest for migrating the B and C column. Even though the VBA code
works..I really like the flexibilty of using the helper column also to
join the columns. Each have their application. Thank you so much.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation bar issues - shared border issues (2 problems) =?Utf-8?B?QW15?= Microsoft Frontpage 3 27th Oct 2007 05:26 PM
Help need with monitor issues ( error code 10, hardware issues) =?Utf-8?B?em9lcGlnbGV0?= Windows XP Hardware 4 20th Jun 2007 03:46 AM
file system issues - chkdsk & defrag (diskeeper) issues tweb Microsoft Windows 2000 File System 1 2nd Mar 2005 02:46 PM
explorer, IE, printing issues, pest patrol issues with XP Tony Windows XP General 0 22nd Sep 2004 03:46 PM
Task Manager issues and Virtual Memory issues among other problems =?Utf-8?B?SmFja2ll?= Windows XP Help 1 28th Apr 2004 09:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 PM.