bhsoundman
Board Regular
- Joined
- Jul 17, 2010
- Messages
- 50
- Office Version
- 365
- Platform
- MacOS
Hi All,
This should be a simple question, but apparently I'm a moron.
This script is intended to copy a worksheet, rename it & the copy a cell value (calculated) from the first sheet to the second sheet.
- Creating the worksheet = no problem
- Renaming that sheet to a calculated name = no problem
- Copying and pasting a cell value if that cell value is text = no problem
- Copying and pasting a cell value if that cell value is numeric = problem in line 14
Can someone please set me straight?
Thanks in advance!
This should be a simple question, but apparently I'm a moron.
This script is intended to copy a worksheet, rename it & the copy a cell value (calculated) from the first sheet to the second sheet.
- Creating the worksheet = no problem
- Renaming that sheet to a calculated name = no problem
- Copying and pasting a cell value if that cell value is text = no problem
- Copying and pasting a cell value if that cell value is numeric = problem in line 14
Can someone please set me straight?
Thanks in advance!
VBA Code:
Sub MakeCallSheet()
Dim WkSht As Worksheet
SourceData = Sheets("Crew").Columns(ActiveCell.Column).Rows(8).Value
SourceData2 = Sheets("Crew").Columns(ActiveCell.Column)
Set WkSht = Nothing
On Error Resume Next
Set WkSht = ActiveWorkbook.Worksheets(SourceData)
On Error GoTo 0
If WkSht Is Nothing Then
Worksheets("Call Sheet").Copy after:=Worksheets("Crew")
ActiveSheet.Name = SourceData
End If
Worksheets("Crew").Select
Sheets(SourceData).Range("F8") = Sheets("Crew").Columns(ActiveCell.Column).Rows(8).Value
Sheets(SourceData).Select
End Sub
Last edited by a moderator: