Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11   Report Post  
Old November 28th 20, 03:02 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2020
Posts: 33
Default Copy paste different size problem

Pe sâmbătă, 28 noiembrie 2020, la 03:23:03 UTC+2, Xxer Xxes a scris:

I took a little work with it , and now this code
work in Column F :

Sub Test()
Dim i As Long, n As Long
Dim varData() As Variant

With ActiveSheet
For i = 51 To 1600
If Len(.Cells(i, "F")) 0 Then
ReDim Preserve varData(n)
varData(n) = .Cells(i, "F")
n = n + 1
End If
Next
..Range("F1").Resize(UBound(varData) + 1) = _
Application.Transpose(varData)
End With
End Sub

But I need this code to bring me the number of the adress of
the row which contain data . I.m pretty shure I'll be not bother
you too soon . I dont make wishes , i just have strongly need
this very clever type of code . Many thanks .

  #12   Report Post  
Old November 28th 20, 11:32 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,832
Default Copy paste different size problem

Hi,

Am Fri, 27 Nov 2020 18:02:24 -0800 (PST) schrieb Xxer Xxes:

But I need this code to bring me the number of the adress of
the row which contain data . I.m pretty shure I'll be not bother
you too soon . I dont make wishes , i just have strongly need
this very clever type of code . Many thanks .


try:

Sub Test()
Dim i As Long, n As Long
Dim varData() As Variant

With ActiveSheet
n = 1
For i = 51 To 1600
If Len(.Cells(i, "F")) 0 Then
ReDim Preserve varData(1 To 2, 1 To n)
varData(1, n) = .Cells(i, "F")
varData(2, n) = i
n = n + 1
End If
Next
.Range("F1").Resize(UBound(varData, 2), 2) = _
Application.Transpose(varData)
End With
End Sub


Regards
Claus B.
--
Windows10
Office 2016
  #13   Report Post  
Old November 28th 20, 07:19 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2020
Posts: 33
Default Copy paste different size problem


ReDim Preserve varData(1 To 2, 1 To n)
varData(1, n) = .Cells(i, "F")
varData(2, n) = i
n = n + 1


It work perfectly !

Thanks , and have a beautifull
weekend Sir !


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
Excel.Chart size changes after copy-paste into Word fmamstr Excel Programming 0 November 11th 09 04:44 AM
Object size by copy/paste is different between Office 2003 and 200 fmamstr Excel Programming 2 October 10th 09 02:56 AM
File size - copy paste values only Nikki Excel Discussion (Misc queries) 1 June 22nd 09 04:54 PM
Cell Size Between Worksheets when performing a copy and paste Kara Excel Discussion (Misc queries) 1 October 27th 06 04:08 AM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 06:16 PM


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

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017