#14
|
||||
|
||||
You could get rid of one line of code by changing where to set the variable 'cnt', like this:
Code:
Sub test() Dim x As Long Dim y As Long Dim cl As Long Dim rw As Long Dim cnt As Long cl = Cells.Find("*", , , , xlByColumns, xlPrevious).Column rw = Cells.Find("*", , , , xlByRows, xlPrevious).Row For x = 1 To cl cnt = 1 For y = 2 To rw If Cells(y, x) <> "" Then Cells(rw + cnt, cl - x + 1) = Cells(y, x) + 1 cnt = cnt + 1 Next y Next x End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
auto fill up | mare1984 | Word | 1 | 06-27-2019 08:09 PM |
Auto Fill Forms | pgilbert0824 | Excel | 2 | 10-30-2016 01:02 AM |
Excel Auto-fill Issues | officeboy09 | Excel | 8 | 01-14-2014 05:52 PM |
auto fill a word doc from another program | hcubed | Office | 0 | 06-19-2013 09:42 PM |
Auto Color Fill Question | Kinar | Excel | 3 | 05-14-2013 07:46 AM |