Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select/Copy/Paste in Macro/VBA

I'm trying to create a macro to preformat an imported text
file. One of the tasks is to concatenate lastname,
firstname, middleinit, suffix that is spread into 4
columns into one column. The number of rows varies with
the imported text file.

I've tried inserting a blank column and building the
concat formula in the top cell, but I'm having a problem
copying this formula down to all the cells below while
STOPPING at the last cell that has data to the right.

Suggestions for this newbie, please?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Select/Copy/Paste in Macro/VBA

Jim,

Assuming you have just entered the formula in A1, and A1 (or A2, or
Awhatever) is the active cell, the following will do it:

i = 1
Do Until IsEmpty(ActiveCell.Offset(i,1))
ActiveCell.Offset(i,0).FormulaR1C1 = ActiveCell.FormulaR1C1
i = i + 1
Loop

HTH,
Nikos

"Jim Clark" wrote in message
...
I'm trying to create a macro to preformat an imported text
file. One of the tasks is to concatenate lastname,
firstname, middleinit, suffix that is spread into 4
columns into one column. The number of rows varies with
the imported text file.

I've tried inserting a blank column and building the
concat formula in the top cell, but I'm having a problem
copying this formula down to all the cells below while
STOPPING at the last cell that has data to the right.

Suggestions for this newbie, please?



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
Select, find in another book, copy, return and paste Watson[_2_] Excel Discussion (Misc queries) 0 August 15th 08 07:14 PM
Not using select for copy and paste damorrison Excel Discussion (Misc queries) 2 April 8th 07 08:41 PM
Select Visible Cells only copy & Paste Kim Excel Programming 2 August 10th 04 03:18 AM
Select File Copy/Paste Macro Help.... Jay Baker Excel Programming 1 January 14th 04 01:01 PM
Select All and copy and paste Ashok[_2_] Excel Programming 7 November 11th 03 03:46 AM


All times are GMT +1. The time now is 01:35 PM.

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"