Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Splitting Column in to 2 columns

Hi,

I have a column of values of finance data. ColumnB with 10 values
($10,$20,$30,$40,$50,$60,$70,$80,$90,$100).

User is prompted to select a row of these 10 rows. Suppose user selects
row#5 with $50 value.

How should I copy the values UPTO row#5 of Column B and paste in Column C
without hardcoding?
How should I copy the values AFTER row#5 UPTO row# 10 of Column B and paste
in Column D without hardcoding?

Thanks...Appreciate your help.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Splitting Column in to 2 columns

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim EndCell As Range

iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
Set EndCell = Application.InputBox("Select the last cell for column C",
Type:=8)
Range("B1").Resize(EndCell.Row).Copy Range("C1")
EndCell.Offset(1, 0).Resize(iLastRow - EndCell.Row).Copy Range("D1")

End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dimri" wrote in message
...
Hi,

I have a column of values of finance data. ColumnB with 10 values
($10,$20,$30,$40,$50,$60,$70,$80,$90,$100).

User is prompted to select a row of these 10 rows. Suppose user selects
row#5 with $50 value.

How should I copy the values UPTO row#5 of Column B and paste in Column C
without hardcoding?
How should I copy the values AFTER row#5 UPTO row# 10 of Column B and

paste
in Column D without hardcoding?

Thanks...Appreciate your help.



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
Sum up columns in different sheet with error check zeyneddine Excel Discussion (Misc queries) 13 July 10th 06 01:21 PM
Summing one column if two other columns' values appear in other sh JulieU Excel Worksheet Functions 3 April 18th 06 04:48 PM
how can i multiply two columns edgar Excel Worksheet Functions 7 March 2nd 06 03:29 PM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
Splitting text in one column into two (or more) columns. RickyDee Excel Worksheet Functions 4 December 7th 04 10:03 PM


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