Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find first blank cell to paste into


HI, in the grand scheme of things i'm trying to write a macro to look a
a named range in one worksheet and copy into a current worksheet, i the
want to copy another named range and paste it in the cell immediatl
after the end of the first range of copied data, this data is then use
to generate a pivot table.

My code looks like the following

Application.Goto Reference:="IO_C"
Selection.Copy
Sheets("consolidate_raw_data").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False

'' end of initial paste Application.Got
Reference:="stat_consol"
Application.CutCopyMode = False
Selection.Copy
Sheets("consolidate_raw_data").Select
Range("A1").Select


''need code to find first empty cell, currently this code is no
dynamic and is looking at static cell values to paste within
Range("A1:E8352").Select
ActiveWindow.SmallScroll Down:=12
Range("A8352").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Rows("8352:8352").Select Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Selection.End(xlUp).Select

The code in red is what is calling the problems as it is an absolut
reference that was stored when i created my first macro. It is m
understanding that a line of code should be in place that dynamicall
finds the end of the first pasted range, selects the cell immediatl
beneath it and then pastes the data within it? Ive tried investigatin
.end but to avail.

Am i going along the right tracks? this is my first attempt at codin
in excel as most of my experience has come from Access

--
cereldin
-----------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...fo&userid=3206
View this thread: http://www.excelforum.com/showthread.php?threadid=52009

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find first blank cell to paste into

Range("IO_C").Copy
Worksheets("consolidate_raw_data") _
.Range("A1").PasteSpecial xlValues
Range("stat_consol").copy
Worksheets("consolidate_raw_data") _
.cells(rows.count,1).End(xlup)(2) _
.PasteSpecial xlValues

--
Regards,
Tom Ogilvy


"cereldine" wrote
in message ...

HI, in the grand scheme of things i'm trying to write a macro to look at
a named range in one worksheet and copy into a current worksheet, i then
want to copy another named range and paste it in the cell immediatly
after the end of the first range of copied data, this data is then used
to generate a pivot table.

My code looks like the following

Application.Goto Reference:="IO_C"
Selection.Copy
Sheets("consolidate_raw_data").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False

'' end of initial paste Application.Goto
Reference:="stat_consol"
Application.CutCopyMode = False
Selection.Copy
Sheets("consolidate_raw_data").Select
Range("A1").Select


''need code to find first empty cell, currently this code is not
dynamic and is looking at static cell values to paste within
Range("A1:E8352").Select
ActiveWindow.SmallScroll Down:=12
Range("A8352").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Rows("8352:8352").Select Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
Selection.End(xlUp).Select

The code in red is what is calling the problems as it is an absolute
reference that was stored when i created my first macro. It is my
understanding that a line of code should be in place that dynamically
finds the end of the first pasted range, selects the cell immediatly
beneath it and then pastes the data within it? Ive tried investigating
end but to avail.

Am i going along the right tracks? this is my first attempt at coding
in excel as most of my experience has come from Access.


--
cereldine
------------------------------------------------------------------------
cereldine's Profile:

http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=520094



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to paste link and not get a zero in the blank cell? Margo M Excel Discussion (Misc queries) 2 October 15th 09 06:29 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
paste to next blank cell/row Yvette Excel Worksheet Functions 1 June 9th 06 03:34 PM
How to find first blank row to paste to? Judy Ward Excel Programming 1 August 26th 05 12:48 AM
copy, find next blank row, paste special location Pete Excel Programming 3 March 20th 05 12:45 AM


All times are GMT +1. The time now is 07:13 AM.

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

About Us

"It's about Microsoft Excel"