• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Moving cells

robh0409

New Member
Hi


I am trying to create a form where the user will be able to move machines from building to building depending on the building, floor and zone they choose. It will also look at the month to determine from when the move needs to happen. It will then reference one of the three tables that holds the serial numbers of all the machines and determine, depending on which table they are in, how many rows to cut and paste.


Firstly, am I doing this the correct way or is there a much simpler solution to my problems


Secondly, this is the code I have so far, I am only building a small prototype to prove to my manager it works and as such it only had 2 buildings and 3 months but obviously the full version will have all the buildings and months

[pre]
Code:
Public Sub UserForm_Initialize()
'Populate building combo box.
Dim rngBuliding As Range
Dim ws As Worksheet
Set ws = Worksheets("LookUpLists")
For Each rngBuilding In ws.Range("Building")
Me.CBBuilding.AddItem rngBuilding.Value
Next rngBuilding

'Populate floor combo box
Dim rngFloor As Range
Set ws = Worksheets("LookUpLists")
For Each rngFloor In ws.Range("Floor")
Me.CBFloor.AddItem rngFloor.Value
Next rngFloor

'Populate zone combo box
Dim rngZone As Range
Set ws = Worksheets("LookUpLists")
For Each rngZone In ws.Range("Zone")
Me.CBZone.AddItem rngZone.Value
Next rngZone

End Sub

Private Sub Save_Click()

Dim TBSerialNo As Integer
Dim CBBuilding As String
Dim TBMonth As String
Dim CBFloor As String
Dim CBZone As String
Dim From_Book As Workbook, To_Book As Workbook
Dim From_Sheet As Worksheet, To_Sheet As Worksheet
Dim sheet_name As String
Dim ws As Worksheet

Sheets("LookUpLists").Visible = True
If TBSerialNo = Index(three_meter_reads) Then
If TBSerialNo = Range("F3:F74") Then
If TBMonth = ("Jan") Then
Sheets("Jan").Visible = True
ElseIf TBMonth = ("Feb") Then
Sheets("Feb").Visible = True
ElseIf TBMonth = ("Mar") Then
Sheets("March").Visible = True
Else: i = MsgBox("Month not found", vbOKOnly)
End If
End If
End Sub
[/pre]

Thanks

Rob
 
Is this not a question relating to this post of yours


http://chandoo.org/forums/topic/forms-1


Cross posting is bad manners and an insult to those you have helped you in previous posts
 
This has been altered since yesterday when that was posted and I haven't had a reply to the question so I thought I would ask it again
 
just because you have not had a reply does not mean that no one is interested in your post, this site is 24/7 and the forum members have many other things to do than just wait for you to post a question and then answer straight away, but if you look at your post you will see that Hui took the time and trouble to point you in the right direction.Re-posting like this is the height of bad manners and an insult to those that have helped.Altering a previous post to make it slightly different to re-post and elicit new reply's is not on.

Personally I think double/cross posters should not be helped...but there are members who through good manners and curtsies will help.
 
Back
Top