M
maemi weirdoke
Hello all,
I have a similar question.
Basically the macro got stuck at this point: ****
Private Sub get_holi_data_Click()
Dim sFileName As String 'gives file
Dim teller1 As Integer
Dim tmp1 As String
Dim datemonth As Integer
Dim datename As String
'Sorts out which month sheet you want
datemonth = Range("E1:E1").Value
Select Case datemonth
Case Is = 1
datename = "January"
Case Is = 2
datename = "February"
Case Is = 3
datename = "March"
Case Is = 4
datename = "April"
Case Is = 5
datename = "May"
Case Is = 6
datename = "June"
Case Is = 7
datename = "July"
Case Is = 8
datename = "August"
Case Is = 9
datename = "September"
Case Is = 10
datename = "October"
Case Is = 11
datename = "November"
Case Is = 12
datename = "December"
End Select
' Import data from holiday
sFileName = Application.GetOpenFilename("Microsoft Excel Files (*.xls),
*.xls")
If sFileName <> "False" Then
Workbooks.Open sFileName, UpdateLinks:=3
Sheets(datename).Select 'works
Range("A4:A60").Select 'stuck here ****
'Range("A4:A4").Select
'MsgBox Range("A4:A4").Select
'Range("A4:A4").Activate
'Range("A60").Activate
' Selection.Copy
Windows("test.xls").Activate 'activate this worksheet --works
Sheets("Temp").Select 'works
'Columns("A:A").Select
'Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
' True, Transpose:=False
Windows(docname).Activate 'works
ActiveWindow.Close 'works
Else
MsgBox ("Please provide a valid holiday xls. document")
End If
End Sub
As I only have "basic" knowledge of VB.net, maybe you can help me out
here?
Any help is much appreciated with of course a little explanation.
*** Sent via Developersdex http://www.developersdex.com ***
I have a similar question.
Basically the macro got stuck at this point: ****
Private Sub get_holi_data_Click()
Dim sFileName As String 'gives file
Dim teller1 As Integer
Dim tmp1 As String
Dim datemonth As Integer
Dim datename As String
'Sorts out which month sheet you want
datemonth = Range("E1:E1").Value
Select Case datemonth
Case Is = 1
datename = "January"
Case Is = 2
datename = "February"
Case Is = 3
datename = "March"
Case Is = 4
datename = "April"
Case Is = 5
datename = "May"
Case Is = 6
datename = "June"
Case Is = 7
datename = "July"
Case Is = 8
datename = "August"
Case Is = 9
datename = "September"
Case Is = 10
datename = "October"
Case Is = 11
datename = "November"
Case Is = 12
datename = "December"
End Select
' Import data from holiday
sFileName = Application.GetOpenFilename("Microsoft Excel Files (*.xls),
*.xls")
If sFileName <> "False" Then
Workbooks.Open sFileName, UpdateLinks:=3
Sheets(datename).Select 'works
Range("A4:A60").Select 'stuck here ****
'Range("A4:A4").Select
'MsgBox Range("A4:A4").Select
'Range("A4:A4").Activate
'Range("A60").Activate
' Selection.Copy
Windows("test.xls").Activate 'activate this worksheet --works
Sheets("Temp").Select 'works
'Columns("A:A").Select
'Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
' True, Transpose:=False
Windows(docname).Activate 'works
ActiveWindow.Close 'works
Else
MsgBox ("Please provide a valid holiday xls. document")
End If
End Sub
As I only have "basic" knowledge of VB.net, maybe you can help me out
here?
Any help is much appreciated with of course a little explanation.
*** Sent via Developersdex http://www.developersdex.com ***