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

Jason

try this:

Selection.AutoFill _
Destination:=Range("N2:" & NintRecords), _
Type:=xlFillDefault

Regards

Trevor


"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



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
Help in macro coding Sasikiran Excel Discussion (Misc queries) 3 March 24th 10 02:34 PM
Help on macro coding for URL Eric Excel Worksheet Functions 2 March 15th 08 02:02 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
Macro Coding JulieB[_2_] Excel Programming 1 October 3rd 03 09:08 PM


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