Fill a series stop with value of another cell
Solved/Closed
bushman
-
Apr 3, 2011 at 11:17 AM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Apr 4, 2011 at 07:01 AM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - Apr 4, 2011 at 07:01 AM
Related:
- Fill a series stop with value of another cell
- Best scandinavian crime series on netflix - Guide
- Audio track download for series - Guide
- Hitman 3 cheats xbox series x - Guide
- Excel send value to another cell - Guide
- Xbox series x 3d blu ray - Guide
2 responses
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
Apr 4, 2011 at 04:10 AM
Apr 4, 2011 at 04:10 AM
Use this code
Sub fillCell() Dim n, lastRow As Long lastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row '' supoose first row in header For i = 2 To lastRow n = Cells(i, 1).Value For j = 2 To n + 1 Cells(i, j).Value = j - 1 Next j Next i End Sub
Hello Womanizer,
Thankyou very much.
At first I tried to understand it, by taking bits and doing my own thing with them. (I wasn't sure where on the sheet I had to run it from, and also where the data had to be.) I couldn't get it to work, and not sure what "x1Up" does for instance, since I don't really know visual basic. Also, how to get into a place where you can enter that code you gave me. In the end, I recorded a short macro, which then allowed me to "view macro" and get onto the macro sheet. THEN I could paste your code in there and run it.)
I did a test with headings a1:a2 and some numbers in a2:a5, pasted your code and "View macros, Run fillCell()...
It works like absolute magic!
It would be nice to understand the elements of your code. I guessed it selects the range and then fills upwards? Is x1Up a VB code word? etc...
I really like this site and am happy to give the feedback following the links as in the email, and appreciate you replying so quickly.
I will now do the feedback links.
Cheers.
Oh - do you do MS Access SQL questions here also?
Bushman
Thankyou very much.
At first I tried to understand it, by taking bits and doing my own thing with them. (I wasn't sure where on the sheet I had to run it from, and also where the data had to be.) I couldn't get it to work, and not sure what "x1Up" does for instance, since I don't really know visual basic. Also, how to get into a place where you can enter that code you gave me. In the end, I recorded a short macro, which then allowed me to "view macro" and get onto the macro sheet. THEN I could paste your code in there and run it.)
I did a test with headings a1:a2 and some numbers in a2:a5, pasted your code and "View macros, Run fillCell()...
It works like absolute magic!
It would be nice to understand the elements of your code. I guessed it selects the range and then fills upwards? Is x1Up a VB code word? etc...
I really like this site and am happy to give the feedback following the links as in the email, and appreciate you replying so quickly.
I will now do the feedback links.
Cheers.
Oh - do you do MS Access SQL questions here also?
Bushman
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
Apr 4, 2011 at 07:01 AM
Apr 4, 2011 at 07:01 AM
Hi Bushman,
In this site there we are many volunteer here to help with your problem.
so also can post you MS Access SQL questions here, someone who is ace in MS Access will definately helps you.
In this site there we are many volunteer here to help with your problem.
so also can post you MS Access SQL questions here, someone who is ace in MS Access will definately helps you.