Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy column data


Hi,

I want to write a macro by whic I will mention the number of character
in one column then it should select only those number of characters fo
the entire row.

eg. if I mention number of characters as 6 for 'column a', (I wil
mention this in a seperate column. Macro should read this value fro
that column) then it should copy only 6 characters of EACH cell i
'column a'

Do we anything kind of format etc for this thing?

Thanks,
Sylvi

--
Sylvi
-----------------------------------------------------------------------
Sylvia's Profile: http://www.excelforum.com/member.php...fo&userid=3030
View this thread: http://www.excelforum.com/showthread.php?threadid=50666

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Copy column data

Where should the values be copied to?

Tim


"Sylvia" wrote in
message ...

Hi,

I want to write a macro by whic I will mention the number of characters
in one column then it should select only those number of characters for
the entire row.

eg. if I mention number of characters as 6 for 'column a', (I will
mention this in a seperate column. Macro should read this value from
that column) then it should copy only 6 characters of EACH cell in
'column a'

Do we anything kind of format etc for this thing?

Thanks,
Sylvia


--
Sylvia
------------------------------------------------------------------------
Sylvia's Profile:
http://www.excelforum.com/member.php...o&userid=30300
View this thread: http://www.excelforum.com/showthread...hreadid=506668



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy column data


In the new worksheet

--
Sylvi
-----------------------------------------------------------------------
Sylvia's Profile: http://www.excelforum.com/member.php...fo&userid=3030
View this thread: http://www.excelforum.com/showthread.php?threadid=50666

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Copy column data

Sub Tester()
Dim s As Worksheet
Dim s2 As Worksheet
Dim r As Long, x

Set s = ActiveSheet
Set s2 = ThisWorkbook.Sheets("Sheet2")

r = 1
x = Application.InputBox("Enter number of characters", _
, , , , , , 1)

Do While s.Cells(r, 1).Value < ""
s2.Cells(r, 1).Value = Left(s.Cells(r, 1).Value, x)
r = r + 1
Loop
End Sub

Tim



"Sylvia" wrote in
message ...

In the new worksheet.


--
Sylvia
------------------------------------------------------------------------
Sylvia's Profile:
http://www.excelforum.com/member.php...o&userid=30300
View this thread: http://www.excelforum.com/showthread...hreadid=506668



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
Macro to copy data when data is detected in another column(s). Richard Excel Worksheet Functions 2 October 23rd 09 11:46 PM
How do you copy all data in a row only if value in column A is "xy kookie Excel Discussion (Misc queries) 1 January 21st 09 07:47 PM
Formula to copy data from every 4th column HighlandRoss Excel Discussion (Misc queries) 5 August 5th 08 06:56 PM
Copy Data from one Column to another JB Excel Discussion (Misc queries) 2 December 10th 05 09:40 AM
How to copy the data in row to column? Suma Charan Excel Worksheet Functions 1 July 19th 05 09:24 AM


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