Find first blank cell to paste into

  • Thread starter Thread starter cereldine
  • Start date Start date
C

cereldine

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top