Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default VBA Do Until Range("xcolumn" & 6) = ""

VBA Do Until Range("xcolumn" & 6) = ""
What I want to do is copy a column (from a worksheet that contains formulas)
and paste the data to
another column on another worksheet (template with dates also) based on month
and year. I want this to happen untill there is no more data for that month.
Then next month I want it to take Feb 06 coulmn and do the same thing, and so
on for the following month. I want to create this macro so that when a person
clicks on a button that is linked to this macro…they update the template
sheet with the current month’s data. I can’t simply copy the whole sheet that
contains the formulas because I don’t want the previous months overwritten in
the template.

Below is an example of my data and what I have so far in VBA …and I know it
is incomplete and perhaps not the right VBA codes I need…please help.

Thank You in advance.
Nadia

moving left to right
Column AD
Inbound Nov-05 Dec-05 Jan-06 Feb-06
Oct-03 0 0 0
Nov-03 3 3 3
Dec-03 9 8 8
Jan-04 62 59 59
Feb-04 132 127 127
Mar-04 221 212 212
Apr-04 180 167 167

xrow = 5
xcolumn = AD
Cxrow2 = 1
Range("AD5") = ("Jan-06")
Range("AE5") = ("Feb-06")
Range("AF5") = ("Mar-06")

Do Until Range("xcolumn" & 6) = ""
Sheets("Reporting month").Select
If Range("L1") = "Jan-06" Then

Range("AD6:AD44").Select
Selection.Copy
Sheets("Data").Select
Range("AD6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

If Range("AE" & xrow) = "Feb-06" Then
Range("AE6:AE44").Select
Selection.Copy
Sheets("Data").Select
Range("AE6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End If
If Range("AF" & xrow) = "Mar-06" Then
Range("AF6:AF44").Select
Selection.Copy
Sheets("Data").Select
Range("AF6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
xcolumn = xcolumn + 1
Exit Do
End If


End Sub
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 - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM


All times are GMT +1. The time now is 08:49 PM.

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"