Marsman
Board Regular
- Joined
- May 13, 2013
- Messages
- 62
- Office Version
- 365
- Platform
- Windows
how would i set my script to remove all the data prior to the Colon in this macro?
Email Example:
[TABLE="width: 377"]
<tbody>[TR]
[TD]Hahahah[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Please be sure to check the API Results below for errors.[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Thank you![/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]API Results : API Call Successful Status OK[/TD]
[/TR]
[TR]
[TD]Power Supply Node : 2C06[/TD]
[/TR]
[TR]
[TD]MAC Address : 00:00:08:14:00:00[/TD]
[/TR]
[TR]
[TD]Power Supply Type : StandBy[/TD]
[/TR]
[TR]
[TD]Power Supply Name : 2C06_-A[/TD]
[/TR]
[TR]
[TD]Power Supply Number : A[/TD]
[/TR]
[TR]
[TD]No. of Batteries : 1 String Of 3[/TD]
[/TR]
[TR]
[TD]AC Output Voltage Rating : 90VAC[/TD]
[/TR]
[TR]
[TD]House Number :[/TD]
[/TR]
[TR]
[TD]Address : Elm St[/TD]
[/TR]
[TR]
[TD]City : Smalltown[/TD]
[/TR]
[TR]
[TD]State : DM[/TD]
[/TR]
[TR]
[TD]Zip : XXXXX[/TD]
[/TR]
[TR]
[TD]Latitude : 27.7509[/TD]
[/TR]
[TR]
[TD]Longitude : -83.8767[/TD]
[/TR]
</tbody>[/TABLE]
With Mysheet
.Range("A1") = "Subject"
.Range("B1") = "Received"
.Range("D1") = "Category"
.Range("E1") = "Continuity API Results"
.Range("F1") = "Power Supply Node"
.Range("G1") = "MAC ADDRESS"
.Range("H1") = "POWER SUPPLY TYPE"
.Range("I1") = "POWER SUPPLY NAME"
.Range("J1") = "POWER SUPPLY NUMBER"
.Range("K1") = "NO. OF BATTERIES"
.Range("L1") = "AC OUTPUT VOLTAGE RATING"
.Range("M1") = "HOUSE NUMBER"
.Range("N1") = "ADDRESS"
.Range("O1") = "CITY"
.Range("P1") = "STATE"
.Range("Q1") = "ZIP"
.Range("R1") = "LATITUDE"
.Range("S1") = "LONGITUDE"
End With
For Each Item In myfolder.Items
Set x = Item
With Mysheet
Lines = Split(x.Body, Chr(10))
.Range("A" & MyRow) = x.Subject
.Range("B" & MyRow) = Format(x.ReceivedTime, "DD/MM/YYYY")
.Range("D" & MyRow) = Lines(0)
.Range("E" & MyRow) = Lines(6)
.Range("F" & MyRow) = Lines(7)
.Range("G" & MyRow) = Lines(8)
.Range("H" & MyRow) = Lines(9)
.Range("I" & MyRow) = Lines(10)
.Range("J" & MyRow) = Lines(11)
.Range("K" & MyRow) = Lines(12)
.Range("L" & MyRow) = Lines(13)
.Range("M" & MyRow) = Lines(14)
.Range("N" & MyRow) = Lines(15)
.Range("O" & MyRow) = Lines(16)
.Range("P" & MyRow) = Lines(17)
.Range("Q" & MyRow) = Lines(18)
.Range("R" & MyRow) = Lines(19)
.Range("S" & MyRow) = Lines(20)
Export Result:
[TABLE="width: 3482"]
<tbody>[TR]
[TD]Subject[/TD]
[TD]Received[/TD]
[TD][/TD]
[TD]Category[/TD]
[TD]Continuity API Results[/TD]
[TD]Power Supply Node[/TD]
[TD]MAC ADDRESS[/TD]
[TD]POWER SUPPLY TYPE[/TD]
[TD]POWER SUPPLY NAME[/TD]
[TD]POWER SUPPLY NUMBER[/TD]
[TD]NO. OF BATTERIES[/TD]
[TD]AC OUTPUT VOLTAGE RATING[/TD]
[TD]HOUSE NUMBER[/TD]
[TD]ADDRESS[/TD]
[TD]CITY[/TD]
[TD]STATE[/TD]
[TD]ZIP[/TD]
[TD]LATITUDE[/TD]
[TD]LONGITUDE[/TD]
[/TR]
[TR]
[TD]RE: Beltway_Power_Supply_Updates[/TD]
[TD]27/04/2017[/TD]
[TD][/TD]
[TD]Hahahah[/TD]
[TD]API Results : API Call Successful Status OK[/TD]
[TD]Power Supply Node : PR368[/TD]
[TD]MAC Address : 00:00:08:14:00:00[/TD]
[TD]Power Supply Type : StandBy[/TD]
[TD]Power Supply Name : 2C06_-A[/TD]
[TD]Power Supply Number : A[/TD]
[TD]No. of Batteries : 1 String Of 3[/TD]
[TD]AC Output Voltage Rating : 90VAC[/TD]
[TD]House Number :[/TD]
[TD]Address : Elm St[/TD]
[TD]City : Smalltown[/TD]
[TD]State : DM[/TD]
[TD]Zip : XXXXX[/TD]
[TD]Latitude : 27.7509[/TD]
[TD]Longitude : -83.8767[/TD]
[/TR]
</tbody>[/TABLE]
would like to see:
[TABLE="width: 3482"]
<tbody>[TR]
[TD]Subject[/TD]
[TD]Received[/TD]
[TD][/TD]
[TD]Category[/TD]
[TD]Continuity API Results[/TD]
[TD]Power Supply Node[/TD]
[TD]MAC ADDRESS[/TD]
[TD]POWER SUPPLY TYPE[/TD]
[TD]POWER SUPPLY NAME[/TD]
[TD]POWER SUPPLY NUMBER[/TD]
[TD]NO. OF BATTERIES[/TD]
[TD]AC OUTPUT VOLTAGE RATING[/TD]
[TD]HOUSE NUMBER[/TD]
[TD]ADDRESS[/TD]
[TD]CITY[/TD]
[TD]STATE[/TD]
[TD]ZIP[/TD]
[TD]LATITUDE[/TD]
[TD]LONGITUDE[/TD]
[/TR]
[TR]
[TD]RE: Power_Supply_Updates[/TD]
[TD]27/04/2017[/TD]
[TD][/TD]
[TD]Hahahah[/TD]
[TD]API Call Successful Status OK[/TD]
[TD]PR368[/TD]
[TD]00:00:08:14:00:00[/TD]
[TD]StandBy[/TD]
[TD]2C06_-A[/TD]
[TD]A[/TD]
[TD]1 String Of 3[/TD]
[TD]90VAC[/TD]
[TD][/TD]
[TD]Elm St[/TD]
[TD]Smalltown[/TD]
[TD]DM[/TD]
[TD]XXXXX[/TD]
[TD="align: right"]27.7509[/TD]
[TD="align: right"]-83.8767
[/TD]
[/TR]
</tbody>[/TABLE]
Email Example:
[TABLE="width: 377"]
<tbody>[TR]
[TD]Hahahah[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Please be sure to check the API Results below for errors.[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Thank you![/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]API Results : API Call Successful Status OK[/TD]
[/TR]
[TR]
[TD]Power Supply Node : 2C06[/TD]
[/TR]
[TR]
[TD]MAC Address : 00:00:08:14:00:00[/TD]
[/TR]
[TR]
[TD]Power Supply Type : StandBy[/TD]
[/TR]
[TR]
[TD]Power Supply Name : 2C06_-A[/TD]
[/TR]
[TR]
[TD]Power Supply Number : A[/TD]
[/TR]
[TR]
[TD]No. of Batteries : 1 String Of 3[/TD]
[/TR]
[TR]
[TD]AC Output Voltage Rating : 90VAC[/TD]
[/TR]
[TR]
[TD]House Number :[/TD]
[/TR]
[TR]
[TD]Address : Elm St[/TD]
[/TR]
[TR]
[TD]City : Smalltown[/TD]
[/TR]
[TR]
[TD]State : DM[/TD]
[/TR]
[TR]
[TD]Zip : XXXXX[/TD]
[/TR]
[TR]
[TD]Latitude : 27.7509[/TD]
[/TR]
[TR]
[TD]Longitude : -83.8767[/TD]
[/TR]
</tbody>[/TABLE]
With Mysheet
.Range("A1") = "Subject"
.Range("B1") = "Received"
.Range("D1") = "Category"
.Range("E1") = "Continuity API Results"
.Range("F1") = "Power Supply Node"
.Range("G1") = "MAC ADDRESS"
.Range("H1") = "POWER SUPPLY TYPE"
.Range("I1") = "POWER SUPPLY NAME"
.Range("J1") = "POWER SUPPLY NUMBER"
.Range("K1") = "NO. OF BATTERIES"
.Range("L1") = "AC OUTPUT VOLTAGE RATING"
.Range("M1") = "HOUSE NUMBER"
.Range("N1") = "ADDRESS"
.Range("O1") = "CITY"
.Range("P1") = "STATE"
.Range("Q1") = "ZIP"
.Range("R1") = "LATITUDE"
.Range("S1") = "LONGITUDE"
End With
For Each Item In myfolder.Items
Set x = Item
With Mysheet
Lines = Split(x.Body, Chr(10))
.Range("A" & MyRow) = x.Subject
.Range("B" & MyRow) = Format(x.ReceivedTime, "DD/MM/YYYY")
.Range("D" & MyRow) = Lines(0)
.Range("E" & MyRow) = Lines(6)
.Range("F" & MyRow) = Lines(7)
.Range("G" & MyRow) = Lines(8)
.Range("H" & MyRow) = Lines(9)
.Range("I" & MyRow) = Lines(10)
.Range("J" & MyRow) = Lines(11)
.Range("K" & MyRow) = Lines(12)
.Range("L" & MyRow) = Lines(13)
.Range("M" & MyRow) = Lines(14)
.Range("N" & MyRow) = Lines(15)
.Range("O" & MyRow) = Lines(16)
.Range("P" & MyRow) = Lines(17)
.Range("Q" & MyRow) = Lines(18)
.Range("R" & MyRow) = Lines(19)
.Range("S" & MyRow) = Lines(20)
Export Result:
[TABLE="width: 3482"]
<tbody>[TR]
[TD]Subject[/TD]
[TD]Received[/TD]
[TD][/TD]
[TD]Category[/TD]
[TD]Continuity API Results[/TD]
[TD]Power Supply Node[/TD]
[TD]MAC ADDRESS[/TD]
[TD]POWER SUPPLY TYPE[/TD]
[TD]POWER SUPPLY NAME[/TD]
[TD]POWER SUPPLY NUMBER[/TD]
[TD]NO. OF BATTERIES[/TD]
[TD]AC OUTPUT VOLTAGE RATING[/TD]
[TD]HOUSE NUMBER[/TD]
[TD]ADDRESS[/TD]
[TD]CITY[/TD]
[TD]STATE[/TD]
[TD]ZIP[/TD]
[TD]LATITUDE[/TD]
[TD]LONGITUDE[/TD]
[/TR]
[TR]
[TD]RE: Beltway_Power_Supply_Updates[/TD]
[TD]27/04/2017[/TD]
[TD][/TD]
[TD]Hahahah[/TD]
[TD]API Results : API Call Successful Status OK[/TD]
[TD]Power Supply Node : PR368[/TD]
[TD]MAC Address : 00:00:08:14:00:00[/TD]
[TD]Power Supply Type : StandBy[/TD]
[TD]Power Supply Name : 2C06_-A[/TD]
[TD]Power Supply Number : A[/TD]
[TD]No. of Batteries : 1 String Of 3[/TD]
[TD]AC Output Voltage Rating : 90VAC[/TD]
[TD]House Number :[/TD]
[TD]Address : Elm St[/TD]
[TD]City : Smalltown[/TD]
[TD]State : DM[/TD]
[TD]Zip : XXXXX[/TD]
[TD]Latitude : 27.7509[/TD]
[TD]Longitude : -83.8767[/TD]
[/TR]
</tbody>[/TABLE]
would like to see:
[TABLE="width: 3482"]
<tbody>[TR]
[TD]Subject[/TD]
[TD]Received[/TD]
[TD][/TD]
[TD]Category[/TD]
[TD]Continuity API Results[/TD]
[TD]Power Supply Node[/TD]
[TD]MAC ADDRESS[/TD]
[TD]POWER SUPPLY TYPE[/TD]
[TD]POWER SUPPLY NAME[/TD]
[TD]POWER SUPPLY NUMBER[/TD]
[TD]NO. OF BATTERIES[/TD]
[TD]AC OUTPUT VOLTAGE RATING[/TD]
[TD]HOUSE NUMBER[/TD]
[TD]ADDRESS[/TD]
[TD]CITY[/TD]
[TD]STATE[/TD]
[TD]ZIP[/TD]
[TD]LATITUDE[/TD]
[TD]LONGITUDE[/TD]
[/TR]
[TR]
[TD]RE: Power_Supply_Updates[/TD]
[TD]27/04/2017[/TD]
[TD][/TD]
[TD]Hahahah[/TD]
[TD]API Call Successful Status OK[/TD]
[TD]PR368[/TD]
[TD]00:00:08:14:00:00[/TD]
[TD]StandBy[/TD]
[TD]2C06_-A[/TD]
[TD]A[/TD]
[TD]1 String Of 3[/TD]
[TD]90VAC[/TD]
[TD][/TD]
[TD]Elm St[/TD]
[TD]Smalltown[/TD]
[TD]DM[/TD]
[TD]XXXXX[/TD]
[TD="align: right"]27.7509[/TD]
[TD="align: right"]-83.8767
[/TD]
[/TR]
</tbody>[/TABLE]