Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Macro for excel - copy column value for all rows

Status
Not open for further replies.

BLKDAWG

Technical User
Aug 24, 2001
10
US
I am creating a VB macro in excel which needs to be run once a month. This macro formats the excel file. Part of the formatting is to add a column(Col A) and repeat a value in that column for all rows in the file. The number of rows will vary each month. I need the macro to repeat the value in Column A where there is a value in Column C. I was trying to use the "The Do While Not IsEmpty, but keep getting syntax errors. Any ideas?

'Insert row to add Transit#
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
Selection.Insert Shift:=xlToRight
Columns("A:A").Select
Selection.NumberFormat = "000000000"
Range("A1").Select
ActiveCell.FormulaR1C1 = "55000262"
Set CurrentCell = ActiveSheet.Range("A1")
Columns("A:A").Select
Do While Not IsEmpty(ActiveSheet.Range("C:C"))
CurrentCell.Select
Selection.Copy
Set NextCell = CurrentCell.Offset(1, 0)
Set CurrentCell = NextCell
NextCell.Select
Loop


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top