Excel Macro Help

J

Jeanne A

How can I edit the following macro to repeat no matter how many rows are in
my spreadsheet?

Sub EnterFix()
'
' EnterFix Macro
' Macro recorded 4/4/2008 by Auskalnis_Jeanne
'

'
Range("A3").Select
ActiveCell.FormulaR1C1 = "213681"
Range("A4").Select
ActiveCell.FormulaR1C1 = "343166"
Range("A5").Select
ActiveCell.FormulaR1C1 = "352980"
Range("A6").Select
ActiveCell.FormulaR1C1 = "355008"
Range("A7").Select
ActiveCell.FormulaR1C1 = "356666"
Range("A8").Select
ActiveCell.FormulaR1C1 = "381720"
Range("A9").Select
ActiveCell.FormulaR1C1 = "384401"
Range("A10").Select
ActiveCell.FormulaR1C1 = "711220"
Range("A11").Select
ActiveCell.FormulaR1C1 = "711320"
Range("A12").Select
ActiveCell.FormulaR1C1 = "711520"
Range("A13").Select
ActiveCell.FormulaR1C1 = "711830"
Range("A14").Select
ActiveCell.FormulaR1C1 = "712380"
Range("A15").Select
ActiveCell.FormulaR1C1 = "713080"
Range("A16").Select
ActiveCell.FormulaR1C1 = "713180"
Range("A17").Select
ActiveCell.FormulaR1C1 = "714080"
Range("A18").Select
ActiveCell.FormulaR1C1 = "714180"
Range("A19").Select
ActiveCell.FormulaR1C1 = "715130"
Range("A20").Select
ActiveCell.FormulaR1C1 = "715150"
Range("A21").Select
ActiveCell.FormulaR1C1 = "715280"
Range("A22").Select
ActiveCell.FormulaR1C1 = "715380"
Range("A23").Select
ActiveCell.FormulaR1C1 = "715480"
Range("A24").Select
ActiveCell.FormulaR1C1 = "715530"
Range("A25").Select
ActiveCell.FormulaR1C1 = "715850"
Range("A26").Select
End Sub
 
M

Mike

For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row
Set curCell = Worksheets("Sheet1").Cells(i, 1)
curCell.Offset(0, 1) = _
"Not sure where you are getting this value"
Next i
 
J

Jeanne A

I think I need to explain what I'm attempting to do. I have a spreadsheet
with numbers already entered in the rows in column A. I'm actually clicking
on cell A3, clicking in the formula bar at the end of the data, and then
hitting the enter key. This places me on cell A4 and then I'm just repeating
for each row. Your procedure
doesn't perform the "clicking in the formula bar & hitting enter". Any
ideas?
 
G

Gord Dibben

Why are you doing this click and ENTER?

To change the data from text to number?

Easier would be to format all to General then copy an empty cell.

Select the entire column of numbers and Paste Special>Add>OK>Esc.


Gord Dibben MS Excel MVP
 
J

Jeanne A

This spreadsheet is a result of an Access query that pulls data from our
Lawson Supply Chain system. For whatever reason when I use vlookup to on
this field it will not recognize the data in the cell until I press enter in
the field. I've trimmed the field, tried formatting the cells several
different ways.

Your solution worked except the fields that contained text characters &
dashes. Any other ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HUGE macro 13
How do I write a looping in VBA in Excel? 2
Totals An Easier Way?? 5
Excel Macro Code Help 9
Macro should Save and Overwrite file 1
Complie Syntax Error 6
find and findnext 1
macro trouble 2

Top