$$Excel-Macros$$ Re: xml download "argument not optional"

2014-01-09 Thread Martin Wheeler
Got the solution Pool needed to be Poola or anything different than Pool as 
it is already being used

Ta,
Martin

On Friday, January 10, 2014 1:41:26 PM UTC+13, Martin Wheeler wrote:
>
> I am trying to convert some code from single sheet to multi-sheet so I can 
> use in an existing excel workbook - up to 70 wk sheets
>
> It is in Public Sub LoadRaceField(wks As Worksheet)
>
> If accepts:-  Set runnerList = xmldoc.SelectNodes("//Runner")
>   
> For I = 0 To (runnerList.Length - 1)
> 
> 
> Set runner = runnerList.Item(I)
> 
> Set runnerNumber = runner.Attributes.getNamedItem("RunnerNo")
> 
>
> but then rejects:- 
>
>Set poolList = xmldoc.SelectNodes("//Pool")
> 
> 
>   For J = 0 To (poolList.Length - 1)
> 
> 
> Set Pool = poolList.Item(J)  GETS STOPPED 
> HERE WHEN COMPILING
>
>  Set poolwin = Pool.Attributes.getNamedItem("PoolType")
>
> Any help would be greatly appreciated.
>
> Ta,
>
> Martin 
>  

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Hi Group

2014-01-09 Thread Manish Safaya
Hi ,

 i am new on this group, would like to be good in excel and VBA, i would
need your help.

Thanks
manish.

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Basole
Hi Tom,
 
Please manually enter the "Cusum" tab, showing the desired result. As for 
the "H" column want the macro to copy the data in this column?

Tks. 

Basole





Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
escreveu:
>
>
>
> Hi All Experts,
>  
> I am looking to copy individual rows of data from one spreadsheet 
> which are separated by a varying amount of other data.
> It is also changing every day via a set of IF functions which pull data 
> daily from production spreadsheets.
> They are also not in order either...
> the rows appear as such:
> 001K
> 002K
> 003K
> 006K
>  
> (varying number of rows)
>  
> B004K
> B005K
> B007K
>  
> etc..
>  
> they need to become:
>  
> 001K
> 002K
> 003K
> B004K
> B005K
> 006K
> B007K
>  
> is there anyway to do this? (i cannot post the spreadsheet as it is 
> confidential data)
> Thanks
> Tom
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ xml download "argument not optional"

2014-01-09 Thread Martin Wheeler
I am trying to convert some code from single sheet to multi-sheet so I can
use in an existing excel workbook - up to 70 wk sheets

It is in Public Sub LoadRaceField(wks As Worksheet)

If accepts:-  Set runnerList = xmldoc.SelectNodes("//Runner")

For I = 0 To (runnerList.Length - 1)


Set runner = runnerList.Item(I)

Set runnerNumber = runner.Attributes.getNamedItem("RunnerNo")


but then rejects:-

   Set poolList = xmldoc.SelectNodes("//Pool")


  For J = 0 To (poolList.Length - 1)


Set Pool = poolList.Item(J)  GETS STOPPED
HERE WHEN COMPILING

 Set poolwin = Pool.Attributes.getNamedItem("PoolType")

Any help would be greatly appreciated.

Ta,

Martin

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Basole
Basole,
That's incredible, how do you do that?! 

Macro to do this, I inserted a function that reverses the data of the 
cell then the code puts the data in ascending order, and then inverts the 
data again.

tks. 

Basole.



Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
escreveu:
>
>
>
> Hi All Experts,
>  
> I am looking to copy individual rows of data from one spreadsheet 
> which are separated by a varying amount of other data.
> It is also changing every day via a set of IF functions which pull data 
> daily from production spreadsheets.
> They are also not in order either...
> the rows appear as such:
> 001K
> 002K
> 003K
> 006K
>  
> (varying number of rows)
>  
> B004K
> B005K
> B007K
>  
> etc..
>  
> they need to become:
>  
> 001K
> 002K
> 003K
> B004K
> B005K
> 006K
> B007K
>  
> is there anyway to do this? (i cannot post the spreadsheet as it is 
> confidential data)
> Thanks
> Tom
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Basole
Hi Tom, 
yes that what you want is possible. To do that I need additional 
information, 
such as name of the workbook, description of the column and rows etc..


Basole. 



Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
escreveu:
>
>
>
> Hi All Experts,
>  
> I am looking to copy individual rows of data from one spreadsheet 
> which are separated by a varying amount of other data.
> It is also changing every day via a set of IF functions which pull data 
> daily from production spreadsheets.
> They are also not in order either...
> the rows appear as such:
> 001K
> 002K
> 003K
> 006K
>  
> (varying number of rows)
>  
> B004K
> B005K
> B007K
>  
> etc..
>  
> they need to become:
>  
> 001K
> 002K
> 003K
> B004K
> B005K
> 006K
> B007K
>  
> is there anyway to do this? (i cannot post the spreadsheet as it is 
> confidential data)
> Thanks
> Tom
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Tom Yaxley
Basole,
That's incredible, how do you do that?! 
is there any way to do it which the whole row and copy the rows into a 
different sheet?
Thanks for all your help
Tom


On Thursday, January 9, 2014 12:33:45 PM UTC, Basole wrote:

> Dear Tom, here me the macro is working perfectly. I am attaching a 
> workbook for you to test.
>
>
> Basole.
>
>
>
> Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
> escreveu:
>>
>>
>>
>> Hi All Experts,
>>  
>> I am looking to copy individual rows of data from one spreadsheet 
>> which are separated by a varying amount of other data.
>> It is also changing every day via a set of IF functions which pull data 
>> daily from production spreadsheets.
>> They are also not in order either...
>> the rows appear as such:
>> 001K
>> 002K
>> 003K
>> 006K
>>  
>> (varying number of rows)
>>  
>> B004K
>> B005K
>> B007K
>>  
>> etc..
>>  
>> they need to become:
>>  
>> 001K
>> 002K
>> 003K
>> B004K
>> B005K
>> 006K
>> B007K
>>  
>> is there anyway to do this? (i cannot post the spreadsheet as it is 
>> confidential data)
>> Thanks
>> Tom
>>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Basole
Dear Tom, here me the macro is working perfectly. I am attaching a workbook 
for you to test.


Basole.



Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
escreveu:
>
>
>
> Hi All Experts,
>  
> I am looking to copy individual rows of data from one spreadsheet 
> which are separated by a varying amount of other data.
> It is also changing every day via a set of IF functions which pull data 
> daily from production spreadsheets.
> They are also not in order either...
> the rows appear as such:
> 001K
> 002K
> 003K
> 006K
>  
> (varying number of rows)
>  
> B004K
> B005K
> B007K
>  
> etc..
>  
> they need to become:
>  
> 001K
> 002K
> 003K
> B004K
> B005K
> 006K
> B007K
>  
> is there anyway to do this? (i cannot post the spreadsheet as it is 
> confidential data)
> Thanks
> Tom
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


GetDataOrder.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12


$$Excel-Macros$$ Re: Data from one column to another without blanks but still in order?

2014-01-09 Thread Tom Yaxley
Hi Basole,
The first step worked but the other two both had errors and I couldn't run 
them.
is there anything you can suggest?
 
Thanks
Tom

On Wednesday, January 8, 2014 3:41:14 PM UTC, Basole wrote:

> 'Hi Tom Yaxley,
>
> 'try this macro, copy and paste the code in sheet1 and to test, put some 
> data in column "A" from cell "A1"
>
> 'Hope this helps.
>
> 'rgd, 
>
> 'Basole. 
>
>
> Sub OrderData()
> Dim orig, rev
> Dim Lastrow As Integer
> Dim i As Long
> Lastrow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
> i = 1
> For i = i To Lastrow
> orig = Cells(i, 1)
> rev = StrReverse(orig)
> Cells(i, 2) = rev
> Next
> Call UpdatData
> Call Invert2
> End Sub
>
> Sub UpdatData()
> ActiveWorkbook.Worksheets(1).Sort.SortFields.Clear
> ActiveWorkbook.Worksheets(1).Sort.SortFields.Add Key:=Range("B1"), _
> 
>  SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
> With ActiveWorkbook.Worksheets(1).Sort
> .SetRange Range("B1:B500")
> .Header = xlNo
> .MatchCase = False
> .Orientation = xlTopToBottom
> .SortMethod = xlPinYin
> .Apply
> End With
> End Sub
>
> Sub Invert2()
> Dim orig2, rev2, result
> Dim z, Lastrow As Integer
> Dim i As Long
> z = Worksheets(1).Cells(Cells.Rows.Count, "B").End(xlUp).Row
> i = 1
> For i = i To z
> orig2 = Cells(i, 2)
> rev2 = StrReverse(orig2)
> Cells(i, 2) = rev2
> Next
> End Sub
>
> '.
>
>
>
>
>
> Em quarta-feira, 8 de janeiro de 2014 11h18min26s UTC-2, Tom Yaxley 
> escreveu:
>>
>>
>>
>> Hi All Experts,
>>  
>> I am looking to copy individual rows of data from one spreadsheet 
>> which are separated by a varying amount of other data.
>> It is also changing every day via a set of IF functions which pull data 
>> daily from production spreadsheets.
>> They are also not in order either...
>> the rows appear as such:
>> 001K
>> 002K
>> 003K
>> 006K
>>  
>> (varying number of rows)
>>  
>> B004K
>> B005K
>> B007K
>>  
>> etc..
>>  
>> they need to become:
>>  
>> 001K
>> 002K
>> 003K
>> B004K
>> B005K
>> 006K
>> B007K
>>  
>> is there anyway to do this? (i cannot post the spreadsheet as it is 
>> confidential data)
>> Thanks
>> Tom
>>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.


$$Excel-Macros$$ Re: help!!! creation code from data in cells

2014-01-09 Thread pmyk
In an excel file,
Change Sheet1 Name as Report and type these:
Sr. Center Name Course Date of Enrol Code
1 Alma Computer Training Institute Suraj basic computer Course 31/12/13 
2 Center3 Name1 Course 5 1/1/2014 
3 Center5 Name2 Course 3 1/4/2014 
4 Center2 Name3 Course 4 1/6/2014 
5 Center4 Name4 Course 2 1/7/2014 
= ==
Change Sheet2 Name as CourseCodes and type these:
Titles of Courses Course Codes
basic computer Course CC1
Course 2 CC2
Course 3 CC3
Course 4 CC4
Course 5 CC5
 =
Change Sheet3 Name as CenterCodes and type these:
Names of Courses Center Codes
Alma Computer Training Institute ACT1
Center2 ACT2
Center3 ACT3
Center4 ACT4
Center5 ACT5
= =
Now, Click Alt-F11.
VB Editor will open.
Insert Userform1.
Add a command Button Control to this form from the tool box.
Rename it as cmdGenerateStudentCodes.
(If you want more guidelines on opening and using VB Editor, refer the Net).
=== =
Now copy this code in Userform1.
[code]
Private Sub cmdGenerateStudentCodes_Click()
 ThisWorkbook.Activate
 Sheets("Report").Select 'Sheet1
 Range("c2").Select
 Dim LstRow As Long
 Dim RowCtr As Long
 Dim CrsTitle As Range
 Dim CntrNam As Range
 Dim srchCrsRange As Range
 Dim srchCenterRange As Range
 Dim FoundCourseTitle As String
 Dim FoundCenterName As String
 Dim StuCounter As Long
 Dim StuNewNum As String
 Dim StuNewCod As String
LstRow = Sheets("Report").Range("C" & Rows.Count).End(xlUp).Row 'to go 
to last data cell inspite of blank cells.  Counts Last Row that has data in 
this column.
RowCtr = 1
Do
 RowCtr = RowCtr + 1 'Row is incremented
 Set CrsTitle = Sheets("Report").Cells(RowCtr, 4) 'RowCtr is Row. value 
in Row col 4 to find. Col 4 has Course Title.
 Set srchCrsRange = ThisWorkbook.Sheets(2).Range("A:B") 'Sheet2 has 
Course Title in ColA and Course Code in ColB
 FoundCourseTitle = Application.VLookup(CrsTitle, srchCrsRange, 2, 
False)  'Col A is Col 1 in this range. So Col B is 2.
 Debug.Print "FoundCourseTitle = " & FoundCourseTitle
 
 Set CntrNam = Sheets("Report").Cells(RowCtr, 2) 'RowCtr is Row. value 
in Row col 2 to find. Col 2 has Center Name.
 Set srchCenterRange = ThisWorkbook.Sheets(3).Range("A:B") 'Sheet3 has 
Center Name in ColA and Center Code in ColB
 FoundCenterName = Application.VLookup(CntrNam, srchCenterRange, 2, 
False)  'Col A is Col 1 in this range. So Col B is 2.
 Debug.Print "FoundCenterName = " & FoundCenterName
Sheets("Report").Select
Range("c" & Trim(Str(RowCtr))).Select
Debug.Print "Mon  = " & Month(Selection.Offset(0, 2))
Debug.Print "Day = " & Day(Selection.Offset(0, 2))
StuCounter = RowCtr - 1
Debug.Print "StuCounter = " & StuCounter
StuNewNum = Trim(Str(StuCounter))
Do While Len(StuNewNum) < 6
 StuNewNum = "0" & StuNewNum
Loop
Debug.Print "StuNewNum = " & StuNewNum
StuNewCod = FoundCourseTitle & "/" & FoundCenterName & _
  "/" & Month(Selection.Offset(0, 2)) & "/" & Day(Selection.Offset(0, 
2)) & "/" & StuNewNum
  Debug.Print "StuNewCod = " & StuNewCod
Selection.Offset(0, 3) = StuNewCod
Loop While RowCtr < LstRow 'will stop if RowCtr > LstRow
MsgBox "Report prepared!"
End Sub
[/code]
Clik the Userform name on the left panel on top portion.
The Code will be hidden and the form will appear.
Click on the tiny triangle on top or close the file, save and open again.
Run the code. Hope this helps.

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.