Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
VBA error 1004 "Select method of Range class failed" | Excel Programming | |||
Error 1004, "select method of range class failed" | Excel Programming | |||
Runtime Error "1004" Select Method of Range Class Failed | Excel Programming | |||
"Run-time error '1004'" Method 'Range' of object '_global' failed. | Excel Programming |