Entering Cells using a Macro

David_UK

Active Member
Joined
Mar 18, 2003
Messages
299
Hi guys,

I need help with a macro, I have a sheet with 12000 lines of data, what I need to is at every 38th line I need to put a number 1 for eg...

Or if you have any other suggestions, please feel free.

David. :)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
David

Can you be a bit more explicit? What exactly are you trying to do? How is your data laid out? How many columns etc? What number do you want to insert?
 

David_UK

Active Member
Joined
Mar 18, 2003
Messages
299
Sorry,

I have 12000 rows, and at intervals of every 38 rows I needed to place a marker, i.e. a number this needs to be in column A. so

Rows 1-37 are blank, then A38 = 1 then A76 = 1 and so on

Hope this helps.

David.
 

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
Rows 1-37 are blank, then A38 = 1 then A76 = 1 and so on

David

Sorry - what is in Column A - data or all blank cells or just some blank cells?
 
L

Legacy 12630

Guest

ADVERTISEMENT

Code:
Dim x%
For x = 38 To 12000 Step 38
    Cells(x, 1) = 1
Next
 

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
Ponsy got in first.

I was just asking the questions in case there was anything that might have influenced the method of solving your problem.
 

Forum statistics

Threads
1,147,508
Messages
5,741,570
Members
423,668
Latest member
Audorin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top