LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie - Help with a macro


Hi all,

I was wondering if someone could give me some pointers. I've been
struggling with this little snippet of code for a little while and
haven't made much progress.

I keep getting
"Run-time error '1004':
Select method of Range class failed "
at the Range("A" & intRow).Select line.

I've also tried Activate, a direct cell with Offset, etc. all without
much success.

It's a simple little macro, that basically goes through a series of
rows in a sheet and copies selected cell values and formats to another
sheet in the same workbook. Basically it creates a 'clean' client
verion of the information. I must be missing something. Help?
Thanks!

Cheers,
Mike

------------------------------------------
Private Sub CreateClientSheet_Click()
Dim CurrentCell As Object
Dim intRow, intCol, RowCount As Integer
Dim usedRng As Range
DetermineUsedRange usedRng
RowCount = usedRng.Cells.Count

For intRow = 19 To RowCount Step 1
Sheets("Equipment List").Select
Range("B" & intRow, "E" & intRow).Select
If Range("D" & intRow).Value = "Subtotal" Or Range("B" &
intRow).Value = "Grand Total" Then
Range("B" & intRow, "G" & intRow).Select
End If
Selection.Copy
Worksheets("Sheet1").Select
Range("A" & intRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Next intRow
Sheets("Equipment List").Select
Range("A1").Select
End Sub
-----------------------------------


--
Mike Basden
------------------------------------------------------------------------
Mike Basden's Profile: http://www.excelforum.com/member.php...o&userid=31321
View this thread: http://www.excelforum.com/showthread...hreadid=510085

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: VBA? Macro? Please Advise... pollywog1961 Excel Discussion (Misc queries) 1 May 29th 06 07:57 PM
Newbie needs macro help please Keith[_15_] Excel Programming 4 December 3rd 04 10:39 PM
Macro newbie VB Newbie Excel Programming 3 November 12th 04 07:08 AM
Loop macro for a Newbie mike Excel Programming 3 December 31st 03 06:35 PM
Macro Help for Newbie Phil Excel Programming 2 October 15th 03 04:57 AM


All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"