LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default (1) VARIABLE IN POSTING CODE (2) LOOPING

1.In the following code I want to incorporate a formula to read $A$8 for
24 in
Offset(0, 24) In other words 24 will be in cell A8. I want the number to
be variable to care of multiple posting for different conditions. Any
assistance.

Set CopyRng = _
Sheets("Sheet2").Range("DH29,DH30,DH31,DH32,DH33,D H34")
Set DestRng = _
Sheets("SALES").Cells(65536, "D").End(xlUp).Offset(0, 24)
i = 0
For Each cell In CopyRng
DestRng.Offset(0, i).Value = cell
i = i + 2
Next

2.I have the following code which copies 38 different cells to another 38
cells.
Assistance required for a Loop formula only if a loop will complete the task
faster than the current code.

Range("DN27").Select
Selection.Copy
Range("DF3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("DP4").Select
Application.CutCopyMode = False
Selection.Copy
Range("DF4").Select
ActiveSheet.Paste
[ code repeated another 36 times]
End Sub

I do not know any VBA but have been able to put together some processes
after perusing the many closely related questions and solutions. Next project
to learn VBA.
Thank you.

--
Robert
 
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
the owner of posting should be able to delete the posting Mahendra Excel Discussion (Misc queries) 7 August 8th 05 07:21 PM
Looping and String Variable Mourinho Excel Programming 4 October 28th 04 10:02 PM
Looping to create Variable Names? Jill E Excel Programming 3 August 10th 04 12:17 AM
Code looping when it should not Todd Huttenstine Excel Programming 3 May 13th 04 09:37 PM
Increment a variable while looping ibeetb Excel Programming 2 September 25th 03 07:15 PM


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