Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Simple Macro to Auto fill Cells

Hi Everyone,

Hope you are all well :)


I have a very simple excel worksheets (Worksheet A and Worksheet B)
which has:

Column A: Empty
Column B: Has entry (First Name) on every cell till row 2000
Column C: Has entry (Last Name) on every cell till row 2000


I know how to get first and last name combined using
(=concatenate(B1," ",C1)) However I have no idea how I can make excel
do this in column A automatically upto row 2000 for worksheet A and B?

Can anyone please help?

Thank you for your help in advance.




James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Simple Macro to Auto fill Cells

It's not elegant, but should do what you want:
Sub Concat()

Range("A2").Select
Dim redRng As Range

Set redRng = Range("A1", Range("A2000").End(xlUp))
For Each cell In redRng

If cell.Value < "" Then
ActiveCell.Offset(0, 0).Select
ActiveCell.FormulaR1C1 = "=RC[1]&"" ""&RC[2]"
ActiveCell.Offset(1, 0).Select
End If

Next cell

End Sub

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"James" wrote:

Hi Everyone,

Hope you are all well :)


I have a very simple excel worksheets (Worksheet A and Worksheet B)
which has:

Column A: Empty
Column B: Has entry (First Name) on every cell till row 2000
Column C: Has entry (Last Name) on every cell till row 2000


I know how to get first and last name combined using
(=concatenate(B1," ",C1)) However I have no idea how I can make excel
do this in column A automatically upto row 2000 for worksheet A and B?

Can anyone please help?

Thank you for your help in advance.




James
.

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
Auto fill cells Cheffred Excel Programming 2 March 17th 09 09:16 PM
Auto Fill Cells Barbara Excel Discussion (Misc queries) 1 July 21st 08 08:04 PM
Simple Help ASAP macro to fill range... Stephen Excel Programming 4 February 9th 07 12:09 PM
auto fill simple data kevatt[_11_] Excel Programming 4 February 15th 06 08:28 AM
Auto fill in cells Man Utd Excel Worksheet Functions 1 June 16th 05 05:32 AM


All times are GMT +1. The time now is 02:10 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"