Please can some one help I been Trying to Wrap my head around this.

jpt145

New Member
Joined
Feb 7, 2018
Messages
4
Hello, let me just say something this is my first time posting to a forum so bear with me and please let me know if i do something wrong or if there is any way to improve.

Okay so the issue is I haven’t worked with Macros before so a lot of research has been put in but I’m at the point I just don’t have any more time. if you could help thanks.


First off i have been informed that Excel is not the best program to do what I want but it’s all I have.

Excel 2016

here is a code that i found on the internet that seems to match what I want and I tweaked it to my needs



Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
' Code goes in the ThisWorkbook specific module
Dim rng As Range
Dim lastrow As Long
Dim DestSh As String
Dim col As Integer

Select Case Sh.Name
Case "Cold Call Input", "Closed Leads"
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
On Error GoTo exitprog
Application.EnableEvents = False
If Sh.Name = "Cold Call Input" Then
DestSh = "Closed Leads"
col = 1
' Set Target Range
lastrow = Sh.Cells(Sh.Rows.Count, "S").End(xlUp).Row

Set rng = Sh.Range("S1:S55" & lastrow) 'this sets the "Range"

' Only look at that range
If Intersect(Target, rng) Is Nothing Then GoTo exitprog
Else
DestSh = "Cold Call Input"
col = 2
End If
If Target.Text = "move" And Sh.Name = "Cold Call Input" Or _
Target.Text = "" And Sh.Name = "Closed Leads" Then
lastrow = Sheets(DestSh).Cells(Sheets(DestSh).Rows.Count, col).End(xlUp).Row + 1
With Target
.EntireRow.Copy Sheets(DestSh).Range("S" & lastrow)
.EntireRow.Delete Shift:=xlUp
End With
End If
End Select
exitprog:
Application.EnableEvents = True
End Sub



if it is red it’s what I changed

what I would like for the Following code to do is "Search a certain cell range in the "Cold Call Input"


Hello, let me just say something this is my first time posting to a forum so bear with me and please let me know if i do something wrong or if there is any way to improve.

Okay so the issue is I haven’t worked with Macros before so a lot of research has been put in but I’m at the point I just don’t have any more time. if you could help thanks.


First off i have been informed that Excel is not the best program to do what I want but it’s all I have.

Excel 2016

here is a code that i found on the internet that seems to match what I want and I tweaked it to my needs



Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
' Code goes in the ThisWorkbook specific module
Dim rng As Range
Dim lastrow As Long
Dim DestSh As String
Dim col As Integer

Select Case Sh.Name
Case "Cold Call Input", "Closed Leads"
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
On Error GoTo exitprog
Application.EnableEvents = False
If Sh.Name = "Cold Call Input" Then
DestSh = "Closed Leads"
col = 1
' Set Target Range
lastrow = Sh.Cells(Sh.Rows.Count, "S").End(xlUp).Row

Set rng = Sh.Range("S1:S55" & lastrow) 'this sets the "Range"

' Only look at that range
If Intersect(Target, rng) Is Nothing Then GoTo exitprog
Else
DestSh = "Cold Call Input"
col = 2
End If
If Target.Text = "move" And Sh.Name = "Cold Call Input" Or _
Target.Text = "" And Sh.Name = "Closed Leads" Then
lastrow = Sheets(DestSh).Cells(Sheets(DestSh).Rows.Count, col).End(xlUp).Row + 1
With Target
.EntireRow.Copy Sheets(DestSh).Range("S" & lastrow)
.EntireRow.Delete Shift:=xlUp
End With
End If
End Select
exitprog:
Application.EnableEvents = True
End Sub



if it is red it’s what I changed

what I would like for the Following code to do is "Search For a certain Values in a cell range in the "Cold Call Input"
worksheet the cell range in this case is "S1:S55" and if a certain value is in a cellSuch as "Red" or "Green". then that entire row is copied and moved to another worksheet which would be "Closed Leads" into a table, but the kicker is i would like them to be copied to the bottom of the table. what I mean by that is like this eample.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD] Fav Color[/TD]
[TD]Phone#[/TD]
[TD]Email[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]JOE[/TD]
[TD]Green[/TD]
[TD]123-4567[/TD]
[TD]1@email[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]JANE[/TD]
[TD]Red[/TD]
[TD]123-4567[/TD]
[TD]2@email[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]BOB[/TD]
[TD]Green[/TD]
[TD]123-4567[/TD]
[TD]3@email[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Insert Here[/TD]
[TD]at the bottom of list[/TD]
[TD]that is already there[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


and once that is pasted on the Closed leads worksheet it is deleted from the Cold Call Input worksheet.
the other code you may notice has it so that if the Fave color is changed then it goes back to the First worksheet at the bottom of that table.


i really need help please let me know any questions.

[TABLE="width: 500"]
<tbody>[TR]
[TD]@Email[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Sorry i Noticed after posting that some things have been copied

Hello, let me just say something this is my first time posting to a forum so bear with me and please let me know if i do something wrong or if there is any way to improve.

Okay so the issue is I havenÂ’t worked with Macros before so a lot of research has been put in but IÂ’m at the point I just donÂ’t have any more time. if you could help thanks.


First off i have been informed that Excel is not the best program to do what I want but itÂ’s all I have.

Excel 2016

here is a code that i found on the internet that seems to match what I want and I tweaked it to my needs



Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
' Code goes in the ThisWorkbook specific module
Dim rng As Range
Dim lastrow As Long
Dim DestSh As String
Dim col As Integer

Select Case Sh.Name
Case "Cold Call Input", "Closed Leads"
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
On Error GoTo exitprog
Application.EnableEvents = False
If Sh.Name = "Cold Call Input" Then
DestSh = "Closed Leads"
col = 1
' Set Target Range
lastrow = Sh.Cells(Sh.Rows.Count, "S").End(xlUp).Row

Set rng = Sh.Range("S1:S55" & lastrow) 'this sets the "Range"

' Only look at that range
If Intersect(Target, rng) Is Nothing Then GoTo exitprog
Else
DestSh = "Cold Call Input"
col = 2
End If
If Target.Text = "move" And Sh.Name = "Cold Call Input" Or _
Target.Text = "" And Sh.Name = "Closed Leads" Then
lastrow = Sheets(DestSh).Cells(Sheets(DestSh).Rows.Count, col).End(xlUp).Row + 1
With Target
.EntireRow.Copy Sheets(DestSh).Range("S" & lastrow)
.EntireRow.Delete Shift:=xlUp
End With
End If
End Select
exitprog:
Application.EnableEvents = True
End Sub



if it is red itÂ’s what I changed

what I would like for the Following code to do is "Search For a certain Values in a cell range in the "Cold Call Input"
worksheet the cell range in this case is "S1:S55" and if a certain value is in a cellSuch as "Red" or "Green". then that entire row is copied and moved to another worksheet which would be "Closed Leads" into a table, but the kicker is i would like them to be copied to the bottom of the table. what I mean by that is like this eample.

[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Name[/TD]
[TD]Fav Color[/TD]
[TD]Phone#[/TD]
[TD]Email[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]JOE[/TD]
[TD]Green[/TD]
[TD]123-4567[/TD]
[TD]1@email[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]JANE[/TD]
[TD]Red[/TD]
[TD]123-4567[/TD]
[TD]2@email[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]BOB[/TD]
[TD]Green[/TD]
[TD]123-4567[/TD]
[TD]3@email[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Insert Here[/TD]
[TD]at the bottom of list[/TD]
[TD]that is already there[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



and once that is pasted on the Closed leads worksheet it is deleted from the Cold Call Input worksheet.
the other code you may notice has it so that if the Fave color is changed then it goes back to the First worksheet at the bottom of that table.


i really need help please let me know any questions.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top