473,396 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to paste data from specific cell to the entire column in another workbook.

I need to copy data from 1 workbook & paste to another workbook which i could do.. but i m not able to paste the data starting from the specific cell...


Below is my code
Expand|Select|Wrap|Line Numbers
  1. Dim wbk As Workbook
  2. strSecondFile = "c:\\v.xls"
  3. ThisWorkbook.Sheets("Sheet2").Range("F:F").Copy
  4.  
  5. Set wbk = Workbooks.Open(strSecondFile)
  6. With wbk.Sheets("Sheet1")
  7.      Range("C:C").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:= _
  8.         False, Transpose:=False
  9. End With
  10. End Sub
  11.  

The problem here is in my target workbook column i want to start paste values from cell "C7"..

whereas for the code above the values r been pasted from "C2" itself..which should not be the case..

It should start paste from "C7" to the entire column below..

Can anyone Plz help me with some solution.
Nov 24 '10 #1
1 2642
TheSmileyCoder
2,322 Expert Mod 2GB
From what I see and understand of your code, your copying column F to column C in your target workbook. I dont see C2 or C7 mentioned anywhere.

I dont think you can copy a column, to something other then a column. In order to achieve what you want, you must select a subset of a column.

For selection: (Excel has a max row of 65536 (256^2). Lets assume you dont need all 65536 rows.
Expand|Select|Wrap|Line Numbers
  1. thisworkbook.sheets(1).range("F1:F64000").copy
And then paste, starting in Cell C7
Expand|Select|Wrap|Line Numbers
  1. wbk.sheets(1).range("C7").pastespecial
Nov 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As...
3
by: Michael Schindler | last post by:
Hello NG How I can delete a specific cell in my Datagrid. I would like if the user is in the column 6 the value changed, after automaticly the value in the column 7 in the same row to delete....
1
by: Raul Cortes | last post by:
Hi. I am using a windowsform datagrid to modify a table. The DataSet seems to be filled fined. The DataTable seems to be ok. I am not using 'read only' anywhere. The DataSource seems to be...
2
by: dismantle | last post by:
Hi everyone im new at vb and i already need help. Is it possible to get a specif cell in a column that i have created using sql database. For example: I made a table that have a 3 columns...
7
by: NeverLift | last post by:
This is probably answered elsewhere, but I've searched the Web and VBA for Excel manual, find no answers. I have a VBA-coded macro in an Excel workbook that is to open another existing workbook --...
4
by: hiitzsdg | last post by:
Hi All, I am completely new to VBA and I am trying to develop a macro in a workbook (Backup.xls). The main functionality of the macro is: 1. It would open another workbook (Source.xls). 2....
5
by: omar999 | last post by:
im able to select & display all table data from sql database on to a webpage. but when I use the response.write method is it possible to output a specific cell with a WHERE or LIKE condition? ...
1
by: shahnawazatiq | last post by:
sirs, can anybody give me the VB code for how to copy user specific data from one workbook to other workbook . example:i am having database on one workbook say "data1" and one other workbook say...
2
by: timleonard | last post by:
I am trying to copy the contents of 6 to 10 worksheets and paste them into one called "coverpage" I have been working with the following code, I've managed to get it to paste data to the coverpage...
0
by: Mariappan E | last post by:
I have two workbook, one is master file, i want some data pick up from master file how i can use find, if the data is available, copy of entire column & past another work if its not there i want...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.