LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need VB Coding Help for a Macro

set rng = Range(cells(1,1),cells(rows.count,1).End(xlup))
rng.offset(0,2).Formula = "=A1&B1"

--
Regards,
Tom Ogilvy

"Tuchik" wrote in message
...
Okay here is the situation: I have a worksheet with 4 columns and X rows.

I
have a macro to concatenate column A and B and then autofill the formula
through 10,000 rows. This is because the spreadsheet may contain anywhere
from 1 to 10,000 records. I want to change this so that the autofill only
concatenates records where there is actually ane entry in the A and B
columns. So I added the following code to promt the user for the number

of
records:

Dim intRecords As Integer
intRecords = InputBox("How many records are in this batch?", "Number

of
Records")

No I just need to get this info. into the autofill part of the macro, so I
tried simply modifying the code like this:

ActiveCell.FormulaR1C1 = "=CONCATENATE(RC[-13],RC[-12])"
Selection.AutoFill Destination:=Range("N2:NintRecords"),
Type:=xlFillDefault

Of course, it's simply not that easy. "NintRecords" does not make sense

to
excel for the autofill and I get a request to debug if I try to run the
macro. So what do I need to do to get the autofill to copy the formula

into
only the cells specified by my intRecords?

Thanks in advance for the help.

Jason



 
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
Help in macro coding Sasikiran Excel Discussion (Misc queries) 3 March 24th 10 02:34 PM
Please help on coding the macro. Eric Excel Worksheet Functions 0 March 11th 08 03:11 PM
coding macro Boss Excel Discussion (Misc queries) 0 November 13th 07 12:17 PM
Need VB Coding Help for a Macro Trevor Shuttleworth Excel Programming 0 August 26th 04 08:39 PM
Macro Coding JulieB[_2_] Excel Programming 1 October 3rd 03 09:08 PM


All times are GMT +1. The time now is 10:40 AM.

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

About Us

"It's about Microsoft Excel"