Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to create vb code to search column 'M' of sheet 'ProCode' and
find all the rows that match the value of Me.CbxDept.text. With this data I would then like to programactilly like to copy the data cell by cell and row by row to the sheet that another code has created. The reason for copying cell by cell is due to the sheet being copied to is formatted with merged cells. This is what I have already. Private Sub BtnGo_Click() Dim WSNew As Worksheet 'Dim rng As Range Dim T As String With Application .ScreenUpdating = False .EnableEvents = False End With 'creates a new sheet from the master sheet T = Me.CbxDept.Text Sheets("MASTER").Copy befo=Sheets(2) Set WSNew = ActiveSheet 'creates the name of 'WSNew' WSNew.name = T 'assigns cell 'J2' equal to 'T' WSNew.Cells(2, 10) = T 'copies all data that matches 'T' to new sheet With Application ..ScreenUpdating = True ..EnableEvents = True End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Creation | Excel Programming | |||
Automate PDF file creation in Excel code | Excel Programming | |||
remove the row value in the pivot table creation code. | Excel Programming | |||
Streamline PivotTable creation code | Excel Programming | |||
code for creation of multiple pivot tables | Excel Programming |