Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Record Macro in Excel, run macro untill last column
Hi,
I want to record macro to perform some functions (e.g., simple funtion as below). I'd like to hv result shown in column B according to input data from col A, but the below macro only run up to certain number of rows (here is 4 rows) only. How about If I input data at column A up to 100 rows, or sometimes 5000 rows, Pls anyone help me, which additional VBA code i should add ii order to run the macro up to numbers of rows at each time. col A col B Items Test BHAKSJDDKF =left(A2,5) BHEKJFKJG BHM5FGF BHPKRG Sub AddPrefix() Range("B2").Select ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],5)" Range("B2:B5").Select Selection.FillDown End Sub Pls. help. Thanks a lot |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Record Macro in Excel, run macro untill last column
Sub AddPrefix()
Range("B2:B" & Range("A" & Rows.Count).End(xlUp).Row).Formula = "=LEFT(RC[-1],5)" End Sub -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "Oamya Kim" wrote: Hi, I want to record macro to perform some functions (e.g., simple funtion as below). I'd like to hv result shown in column B according to input data from col A, but the below macro only run up to certain number of rows (here is 4 rows) only. How about If I input data at column A up to 100 rows, or sometimes 5000 rows, Pls anyone help me, which additional VBA code i should add ii order to run the macro up to numbers of rows at each time. col A col B Items Test BHAKSJDDKF =left(A2,5) BHEKJFKJG BHM5FGF BHPKRG Sub AddPrefix() Range("B2").Select ActiveCell.FormulaR1C1 = "=LEFT(RC[-1],5)" Range("B2:B5").Select Selection.FillDown End Sub Pls. help. Thanks a lot |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to enter record number in column A | Excel Programming | |||
How do I record a macro to move down and over to specific column | Excel Discussion (Misc queries) | |||
Record Macro - Record custom user actions | Excel Programming | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
How to record macro to work on selected column/row? | Excel Programming |