Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help in macro coding | Excel Discussion (Misc queries) | |||
Help on macro coding for URL | Excel Worksheet Functions | |||
Please help on coding the macro. | Excel Worksheet Functions | |||
coding macro | Excel Discussion (Misc queries) | |||
Macro Coding | Excel Programming |