ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   school timetable (https://www.excelbanter.com/excel-programming/418026-school-timetable.html)

kkwong27

school timetable
 
col A col B col C col D col E Col G
1 7M
2 4E
3
4


In col G i have 7hours math,4 hour English ect. How to auto generate by fill
Ro 1 col A, B, C, D, E, WITH M M M M M and the balance 2M into Row 2
col A, B, and E E E in row 2 col C, D, E and Row 3 col A with E etc
as below
col A col B col C col D col E Col G
1 M M M M M 7M
2 M M E E E 4E
3 E
4







kk

joel

school timetable
 
Sub Fill()

RowNum = 1
ColNum = 1
RowCount = 1
Count = 0
Do While (Range("G" & RowCount) < "") Or _
(Count 0)

If Count = 0 Then
Count = Val(Range("G" & RowCount))
Char = Range("G" & RowCount)
RowCount = RowCount + 1
End If
'remove digits for shr
Do While IsNumeric(Left(Char, 1))
Char = Mid(Char, 2)
Loop
Cells(RowNum, ColNum) = Char
ColNum = ColNum + 1
If ColNum 5 Then
ColNum = 1
RowNum = RowNum + 1
End If
Count = Count - 1
Loop
End Sub


"kkwong27" wrote:

col A col B col C col D col E Col G
1 7M
2 4E
3
4


In col G i have 7hours math,4 hour English ect. How to auto generate by fill
Ro 1 col A, B, C, D, E, WITH M M M M M and the balance 2M into Row 2
col A, B, and E E E in row 2 col C, D, E and Row 3 col A with E etc
as below
col A col B col C col D col E Col G
1 M M M M M 7M
2 M M E E E 4E
3 E
4







kk



All times are GMT +1. The time now is 12:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com