excel vba - VBA auto increament number -
i want add auto incrementing number end of value each row of information returned.
here have. want have j1.1 first row , j1.2, j1.3, etc.
' j1 bars curcol = 2 lastcol if .cells(22, curcol).value = "" ' nothing else destrow = sheets("barlist").range("b" & rows.count).end(xlup).row + 1 'quantity sheets("barlist").range("a" & destrow).value = "1" 'bar size sheets("barlist").range("b" & destrow).value = .range("b16") 'bar mark sheets("barlist").range("d" & destrow).value = "j1.1" 'shape sheets("barlist").range("e" & destrow).value = "17" 'b dimension sheets("barlist").range("g" & destrow).value = .range("c20") 'c dimension sheets("barlist").range("h" & destrow).value = .cells(22, curcol).value end if next curcol
is mean?
' j1 bars ' define variable count rows? dim rowcounter integer rowcounter = 0 curcol = 2 lastcol if .cells(22, curcol).value = "" ' nothing else destrow = sheets("barlist").range("b" & rows.count).end(xlup).row + 1 'quantity sheets("barlist").range("a" & destrow).value = "1" 'bar size sheets("barlist").range("b" & destrow).value = .range("b16") 'increment row counter rowcounter = rowcounter + 1 'bar mark incremented row counter sheets("barlist").range("d" & destrow).value = "j1." & rowcounter 'shape sheets("barlist").range("e" & destrow).value = "17" 'b dimension sheets("barlist").range("g" & destrow).value = .range("c20") 'c dimension sheets("barlist").range("h" & destrow).value = .cells(22, curcol).value end if next curcol