Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Help with VBA

Try this. UN tested
Sub_Copy_Discrepancy_Tools ()
with Sheets ("INV")
dest=.Cells (Rows.Count, "A") .End(xlup) (2, 1)
If .Range ("A39") < "Shortage" Then
Sheets ("Discrepancy Tools") .Range (A1:P201") .copy dest
Else
Sheets ("Discrepancy Tools") . Range ("Q1:AF266") .Copy dest
end if
end with
End Sub.


--
Don Guillett
SalesAid Software

"Sam Fowler" wrote in message
...
HI I posted this earlier, but wasn't very clear as to what I am trying to

do. I have a macro that selects data on a work sheet and qualifies what
additional data to copy to the bottom of the report. Some of the rows on the
first sheet may be sized differently and I would like to select all rows
after the last cell containing data and set the row height to 12.75, before
pasting the copied data. I would actually like to set this on at least 1ooo
rows, if not all of the way to the bottom.

I would like this to happen immediately after last cell is selected and

before the paste operation.

Thanks for any help on this,
Sam

This is the current code I am using

Sub_Copy_Discrepancy_Tools ()

Sheets ("INV") . Select
Range ("A39") .Select
IF Range ("A39") < "Shortage" Then
Sheets ("Discrepancy Tools") .Select
Range (A1:P201") .Select
Else: Sheets ("Discrepancy Tools") . Select
Range ("Q1:AF266") .Select
Endif
Selection. Copy

Sheets ("INV") .Select

Dim LastCell = Worksheets ("INV") .Cells (Rows.Count, "A") .End(xlup) (2,

1)
Lastcell.Worksheet.Select
LastCell.Select
Activesheet.Paste

End Sub.





Reply
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



All times are GMT +1. The time now is 03:15 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"