excel vba - copy formula and generate new sheets -


If I have a column named 'value' with only 1 column, such as:

 < Code> Column A --------- emp_id emp_name dept_id   

and then a 2 sheet called 'SQL', in which cells with 2 columns like:

  Columns A -------- = "Select the number (*) from Texle where" & amp; A1 and "null;" = "Select Count (*) based on the table where the length (" & amp; A1 & amp; ">> gt; 10;" Column B. -------- Sheet for blank sheet for length   

What is the VBA macro code (note I need it in VBA because I have to generate sheets Button) Would I need to generate the following two output sheets (each sheet with only one column):

  Sheet for blank -------- ---------- - Select the number (*) from the table x where emp_id is zero; Select the number (*) from the table (x) where emp_name is zero; Select the number (*) from the table (x) where dept_id is zero; Sheet for length ------------------- Select the table count (*) where the length (emp_id) is gt; 10; Table (where) length (emp_name) & gt; Count (*) from 10; Select Count (*) from the table () where the length (dept_id) & gt; 10;  

I think this will do what you are asking.

The change I made is that on the "SQL" sheet, I have changed the contents of the cell to look like this:

  = "Selection of the table Do not count (*) from where the variable is redundant; "   

Then I used " Variable " instead of " & amp; A1 & amp; ," and then in the code Emp_id, emp_name, etc. replaces this word with the correct value.

 
sub-generated sheet (range) dim dim formula string as dim formula range range as dim dim destloc range Dim VariableRange as set form formula range = worksheets ("SKL"). Room (1, 1) Get each formula according to the formula range. Value = "" in the formula for each R. Rows found in each formula, create a new sheet and move it to eliminate worksheets. Add ActiveSheetName = r.Offset (0, 1). After the Value ActiveSheet.Move: = Sheets (ActiveWorkbook.Sheets.Count) Set Destloc = ActiveSheet.Cells (1, 1) Set VariableRange = Worksheet ("Value"). Loop through all the variables in the cell (1.1) until the VariableRange.Value = "destloc.Value = change (formulaRange.Value," variable ", VariableRange.Value), VariableRange = Set VariableRange.Offset (1, 0) Set destloc = Destloc.Offset (1, 0) loop next formula = formula = formula. Offset (1, 0) Loop End Sub

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -