473,324 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to get the Next alphabet...in vb6

Hi all

I am working on excel, Macros with vb6....When I was writing the for loop I got stuck with getting the next alphabet...Like I need to extract the data from a database and I need to split that data in to equal parts and each part should go to diff column in the excel sheet like A, B, C, D.....Z
if you look at the code

For n = 0 To 20
Avg = (ls - ks) / qs
n = n + 1
Range("A" & (ks + ((n - 1) * Avg) + 1) & ": A" & (ks + (n * Avg))).Select
Selection.Copy
Sheets("Sheet3").Select
Range("A1").Select
ActiveSheet.Paste
Sheets("Subtest").Select
Next
in the code if you look at the Bold letters...and when the loop is running I need the Next alphabet in the place of A i.e. B,C,D,E...Z like that it should go...

Can you please help me in this case...fast reply would be of gr8 help...

thnq

Regards
Jul 30 '09 #1

✓ answered by ubentook

Replace...
Range("A1").Select

With...
Cells(Rows.Count, 1).End (xlup).Offset(1, 0).Select

3 3063
Replace...
Range("A1").Select

With...
Cells(Rows.Count, 1).End (xlup).Offset(1, 0).Select
Aug 1 '09 #2
thnq for the reply...

when I replace the line with the mentioned line the output stays only in one column...i.e. in column A...but I want the partition in different columns like A, B, C, D....Z
For n = 1 To 20
n = n + 1
Range("A" & (ks + ((n - 1) * Avg) + 1) & ": A" & (ks + (n * Avg))).Select
Selection.Copy
Sheets("Sheet3").Select
Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Sheets("Subtest").Select
Next
Aug 4 '09 #3
It works for me in Excel 2002...
If four adjoining cells are copied then the paste occurs in four adjoining cells.
Aug 4 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Stefan Krah | last post by:
Hello, I am currently writing code where it is convenient to convert char to int . The conversion function relies on a character set with contiguous alphabets. int set_mesg(Key *key, char...
8
by: Jack Addington | last post by:
I want to scroll through the alphabet in order to scroll some data to the closest name that starts with a letter. If the user hits the H button then it should scroll to the letter closest to H. ...
9
by: booksnore | last post by:
I am writing some code to search for strings that contain every letter of the alphabet. At the moment I am using the method below to check to see if a string contains every letter of the alphabet....
31
by: Joe Smith | last post by:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789" " " "!#%^&*()-_" "+=~\|;:\'" "\"{},.<>/\?" "\a\b\f\n\r\t\v\\" Do the above string literals comprise an alphabet for C?...
0
by: rockdale | last post by:
Hi, all: I implemented an alphabet list so that when user click letter A then I will re-bind a gridview control using SQL stored procedure. It works fine. The problem is I populate my alphabet...
6
by: new2script | last post by:
Hi, I'm very new to c++. I need to write a prgrm that convert each character received into the next character in the alphabet. As a special case convert z to a. Here what I wrote so far. ...
1
by: kannabiran | last post by:
Hi, Im using C# ASP.Net here in the textbox i need to get the input as like follows ,any alphabet or any alphabet,any alphabet for example ,C or C,E like this i want to get the input.The...
12
by: paitoon | last post by:
Hi, I got a little bit problem about search result in my site. When i put the keyword and click on search ....everything work fine i got the correct result but they not order by the keyword,but...
20
by: geebanga88 | last post by:
HI i have a method that is supose to store the alphabet in an array however dont think that it is being added to the array. public static void GetAlphabet (char alphabet) { int...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.